1
0
Fork 0
mirror of https://github.com/ryanccn/flake.git synced 2026-01-27 04:06:28 +01:00

refactor: use snowfall

This commit is contained in:
Ryan Cao 2024-02-10 11:56:31 +08:00
parent bb39b10e1f
commit de8503d9a6
Signed by: ryanccn
SSH key fingerprint: SHA256:NtP/BlVhoQq4xU6BEcZeT8nIPvHntkJ3lIc2yB+F09E
34 changed files with 181 additions and 194 deletions

149
flake.lock generated
View file

@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1705399930,
"narHash": "sha256-JZG+pAe78RYnp9dYegalSwUTZqbNcSRmJjPnDZRl+JI=",
"lastModified": 1707355110,
"narHash": "sha256-S3mesqNxuY4kEHrTaqX5zVs8u31/YcpZ52GGl7sq7PE=",
"owner": "ryanccn",
"repo": "am",
"rev": "a68d35ca256622db496e1e5d8165c6dfd08d2469",
"rev": "75deb936a48ad74c647d3890893a601d91f1f04d",
"type": "github"
},
"original": {
@ -22,11 +22,11 @@
},
"catppuccin": {
"locked": {
"lastModified": 1705010618,
"narHash": "sha256-7mFUoNL0Ty/akEcXtAKueZbYbeDy0IOAS02w7ufgslU=",
"lastModified": 1707140582,
"narHash": "sha256-Wzq2W08mSfJ/M1yRQWGwvuEEwQn3+xDx82/9FrouDzw=",
"owner": "Stonks3141",
"repo": "ctp-nix",
"rev": "310ab70d9e690b641005ceafc6582305195c8711",
"rev": "948fe713ea548764a0a3f122975b8d79c44b7054",
"type": "github"
},
"original": {
@ -78,11 +78,11 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1706595721,
"narHash": "sha256-nf5/lPawM20WO1gHAlsUwDEJ4v+InC3BYYV1EBsBJZk=",
"lastModified": 1706941198,
"narHash": "sha256-t6/qloMYdknVJ9a3QzjylQIZnQfgefJ5kMim50B7dwA=",
"owner": "nix-community",
"repo": "fenix",
"rev": "46a368edf5f1cc16573157797e5acead834d5b2c",
"rev": "28dbd8b43ea328ee708f7da538c63e03d5ed93c8",
"type": "github"
},
"original": {
@ -96,9 +96,7 @@
"fenix": [
"fenix"
],
"flake-compat": [
"flake-compat"
],
"flake-compat": [],
"naersk": [
"naersk"
],
@ -119,22 +117,6 @@
"url": "https://flakehub.com/f/DeterminateSystems/fh/0.%2A.tar.gz"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
@ -153,6 +135,42 @@
"type": "github"
}
},
"flake-utils-plus": {
"inputs": {
"flake-utils": "flake-utils_2"
},
"locked": {
"lastModified": 1696331477,
"narHash": "sha256-YkbRa/1wQWdWkVJ01JvV+75KIdM37UErqKgTf0L54Fk=",
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "bfc53579db89de750b25b0c5e7af299e0c06d7d3",
"type": "github"
},
"original": {
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -160,11 +178,11 @@
]
},
"locked": {
"lastModified": 1706473109,
"narHash": "sha256-iyuAvpKTsq2u23Cr07RcV5XlfKExrG8gRpF75hf1uVc=",
"lastModified": 1707467182,
"narHash": "sha256-/Bw/xgCXfj4nXDd8Xq+r1kaorfsYkkomMf5w5MpsDyA=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "d634c3abafa454551f2083b054cd95c3f287be61",
"rev": "5b9156fa9a8b8beba917b8f9adbfd27bf63e16af",
"type": "github"
},
"original": {
@ -220,11 +238,11 @@
]
},
"locked": {
"lastModified": 1706581965,
"narHash": "sha256-1H7dRdK9LJ7+2X1XQtbwXr+QMqtVVo/ZF0/LIvkjdK8=",
"lastModified": 1706833576,
"narHash": "sha256-w7BL0EWRts+nD1lbLECIuz6fRzmmV+z8oWwoY7womR0=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "91b9daf672c957ef95a05491a75f62e6a01d5aaf",
"rev": "bdbae6ecff8fcc322bf6b9053c0b984912378af7",
"type": "github"
},
"original": {
@ -235,11 +253,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1706487304,
"narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=",
"lastModified": 1707451808,
"narHash": "sha256-UwDBUNHNRsYKFJzyTMVMTF5qS4xeJlWoeyJf+6vvamU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "90f456026d284c22b3e3497be980b2e47d0b28ac",
"rev": "442d407992384ed9c0e6d352de75b69079904e4e",
"type": "github"
},
"original": {
@ -256,11 +274,11 @@
]
},
"locked": {
"lastModified": 1706444613,
"narHash": "sha256-DeLsDDC+AyKeQ7YPk1nUyVMXTELm7np55sri0DYy4xE=",
"lastModified": 1707057654,
"narHash": "sha256-WrpyT5h+eoCu7cspf9KGaM0FgLmnBm8tOHIWbj8sYpo=",
"owner": "ryanccn",
"repo": "nrr",
"rev": "8d846528c5e71702fedb2c675d7a18ff3330da23",
"rev": "73d2e8e419498cca910a41a32ce933b1fb0d043c",
"type": "github"
},
"original": {
@ -291,11 +309,11 @@
"ohmyzsh": {
"flake": false,
"locked": {
"lastModified": 1706646978,
"narHash": "sha256-5vbO9OsIMfnTDL7tUOV8EUcQ512jQpxaVmoF10hAKyU=",
"lastModified": 1707403294,
"narHash": "sha256-7S6UZCcUgBguoVaDWG4xGGQI2ePIVjz2L8aketzYbOw=",
"owner": "ohmyzsh",
"repo": "ohmyzsh",
"rev": "e195c7cb438224e8bcea20bdbc2e4b8a6bb3949b",
"rev": "fff073b55defed72a0a1aac4e853b165f208735b",
"type": "github"
},
"original": {
@ -312,7 +330,6 @@
"darwin-custom-icons": "darwin-custom-icons",
"fenix": "fenix",
"fh": "fh",
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"home-manager": "home-manager",
"naersk": "naersk",
@ -322,17 +339,18 @@
"nrr": "nrr",
"nyoom": "nyoom",
"ohmyzsh": "ohmyzsh",
"snowfall-lib": "snowfall-lib",
"vivid-zsh": "vivid-zsh"
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1706540258,
"narHash": "sha256-6RTztJE21l0hfWHp0qMWBurWnoFmUxYEDCvaGTnQYcA=",
"lastModified": 1706875368,
"narHash": "sha256-KOBXxNurIU2lEmO6lR2A5El32X9x8ITt25McxKZ/Ew0=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "d13951f25c4cb880bff09a3c02a796ecc51f69ac",
"rev": "8f6a72871ec87ed53cfe43a09fb284168a284e7e",
"type": "github"
},
"original": {
@ -342,6 +360,28 @@
"type": "github"
}
},
"snowfall-lib": {
"inputs": {
"flake-compat": [],
"flake-utils-plus": "flake-utils-plus",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1696432959,
"narHash": "sha256-oJQZv2MYyJaVyVJY5IeevzqpGvMGKu5pZcCCJvb+xjc=",
"owner": "snowfallorg",
"repo": "lib",
"rev": "92803a029b5314d4436a8d9311d8707b71d9f0b6",
"type": "github"
},
"original": {
"owner": "snowfallorg",
"repo": "lib",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
@ -357,6 +397,21 @@
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"vivid-zsh": {
"flake": false,
"locked": {

View file

@ -1,6 +1,4 @@
{
description = "Ryan's MacBook Pro flake";
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixpkgs-unstable";
@ -16,6 +14,12 @@
inputs.nixpkgs.follows = "nixpkgs";
};
snowfall-lib = {
url = "github:snowfallorg/lib";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-compat.follows = "";
};
catppuccin = {
url = "github:Stonks3141/ctp-nix";
};
@ -50,7 +54,7 @@
inputs.nixpkgs.follows = "nixpkgs";
inputs.fenix.follows = "fenix";
inputs.naersk.follows = "naersk";
inputs.flake-compat.follows = "flake-compat";
inputs.flake-compat.follows = "";
};
naersk = {
@ -80,29 +84,16 @@
flake-utils = {
url = "github:numtide/flake-utils";
};
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = {
nix-darwin,
home-manager,
darwin-custom-icons,
...
} @ inputs: {
darwinConfigurations.Ryans-MacBook-Pro = nix-darwin.lib.darwinSystem {
modules = [
outputs = inputs:
inputs.snowfall-lib.mkFlake {
inherit inputs;
src = ./.;
system.modules.darwin = with inputs; [
home-manager.darwinModules.home-manager
darwin-custom-icons.darwinModules.default
./system.nix
];
specialArgs = {
inherit inputs;
};
};
};
}

View file

@ -8,27 +8,6 @@
imports = [
inputs.catppuccin.homeManagerModules.catppuccin
inputs.am.homeManagerModules.default
./variables.nix
./fonts.nix
./apps/vscode.nix
./programs/zsh.nix
./programs/fish.nix
./programs/starship.nix
./programs/fzf.nix
./programs/zoxide.nix
./programs/direnv.nix
./programs/git.nix
./programs/bat.nix
./programs/helix.nix
./programs/go.nix
./programs/eza.nix
./programs/rust.nix
./programs/glamour.nix
./programs/tealdeer.nix
];
services.am-discord-rich-presence = {

View file

@ -1,5 +1,5 @@
{lib, ...}: let
aliases = import ./aliases.nix;
aliases = import ../aliases;
shellAbbrs = builtins.mapAttrs (_: a: a.command) (lib.filterAttrs (_: b: !(b.fishAlias or false)) aliases);
shellAliases = builtins.mapAttrs (_: a: a.command) (lib.filterAttrs (_: b: builtins.hasAttr "fishAlias" b && b.fishAlias) aliases);
in {
@ -29,7 +29,7 @@ in {
};
home.file.".config/fish/conf.d" = {
source = ./fish/conf.d;
source = ./conf.d;
recursive = true;
};
}

View file

@ -10,6 +10,19 @@ in {
};
home.packages = with pkgs; [
(fenix.combine (
with fenix;
with stable; [
cargo
rustc
rustfmt
clippy
rust-src
llvm-tools-preview
targets.wasm32-unknown-unknown.stable.rust-std
]
))
cargo-bloat
cargo-cache
cargo-deny

View file

@ -3,14 +3,14 @@
lib,
...
}: let
extensions = [
extensions = builtins.map lib.strings.toLower [
"antfu.icons-carbon"
"antfu.unocss"
"astro-build.astro-vscode"
"bierner.lit-html"
"bmalehorn.vscode-fish"
"bradlc.vscode-tailwindcss"
"Catppuccin.catppuccin-vsc"
# "Catppuccin.catppuccin-vsc"
# "Catppuccin.catppuccin-vsc-icons"
"charliermarsh.ruff"
"dbaeumer.vscode-eslint"
@ -19,7 +19,7 @@
"DotJoshJohnson.xml"
"eamodio.gitlens"
"EditorConfig.EditorConfig"
"enkia.tokyo-night"
# "enkia.tokyo-night"
"esbenp.prettier-vscode"
"github.vscode-github-actions"
"GraphQL.vscode-graphql"
@ -27,7 +27,7 @@
"golang.go"
"griimick.vhs"
"LeonardSSH.vscord"
# "jdinhlife.gruvbox"
"jdinhlife.gruvbox"
"jnoortheen.nix-ide"
"miguelsolorio.symbols"
"ms-python.isort"
@ -54,7 +54,7 @@ in {
enable = true;
package = pkgs.stdenv.mkDerivation {
pname = "vscode";
version = "1.85.2";
version = "1.86.0";
src = pkgs.emptyDirectory;
installPhase = ''
mkdir -p $out
@ -65,7 +65,7 @@ in {
mutableExtensionsDir = true;
userSettings = {
"workbench.colorTheme" = "Tokyo Night";
"workbench.colorTheme" = "Gruvbox Dark Hard";
"workbench.iconTheme" = "symbols";
"workbench.productIconTheme" = "icons-carbon";
"workbench.sideBar.location" = "left";

View file

@ -3,7 +3,7 @@
inputs,
...
}: let
shellAliases = builtins.mapAttrs (_: alias: alias.command) (import ./aliases.nix);
shellAliases = builtins.mapAttrs (_: alias: alias.command) (import ../aliases);
in {
programs.zsh = {
enable = true;
@ -13,9 +13,9 @@ in {
syntaxHighlighting.enable = true;
envExtra = builtins.readFile ./zsh/envExtra.zsh;
envExtra = builtins.readFile ./envExtra.zsh;
# initExtraBeforeCompInit = builtins.readFile ./zsh/initExtraBeforeCompInit.zsh;
initExtra = builtins.readFile ./zsh/initExtra.zsh;
initExtra = builtins.readFile ./initExtra.zsh;
inherit shellAliases;

View file

@ -0,0 +1,8 @@
{pkgs}: {
system.activationScripts.extraActivation = {
text = ''
set -eo pipefail
HOME="/var/root" ${pkgs.lib.getExe pkgs.nvd} --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig"
'';
};
}

View file

@ -3,9 +3,7 @@
inputs,
config,
...
}: let
flakeOverlays = import ../overlays;
in {
}: {
services.nix-daemon.enable = true;
nix.package = pkgs.nix;
@ -26,17 +24,6 @@ in {
trusted-users = ["ryanccn"];
sandbox = true;
extra-substituters = [
"https://nix-community.cachix.org"
"https://crane.cachix.org"
"https://cache.garnix.io"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"crane.cachix.org-1:8Scfpmn9w+hGdXH/Q9tTLiYAE/2dnJYRJP7kl80GuRk="
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
];
nix-path = config.nix.nixPath;
};
@ -49,8 +36,6 @@ in {
inputs.choirpack.overlays.default
inputs.nyoom.overlays.default
inputs.fh.overlays.default
flakeOverlays.ryan-mono-bin
flakeOverlays.ibm-plex
];
config.allowUnfree = true;

View file

@ -15,19 +15,6 @@
nix-melt
# fh
(fenix.combine (
with fenix;
with stable; [
cargo
rustc
rustfmt
clippy
rust-src
rust-docs
targets.wasm32-unknown-unknown.stable.rust-std
]
))
fnm
deno
bun

View file

@ -1,4 +0,0 @@
{
ibm-plex = import ./ibm-plex.nix;
ryan-mono-bin = import ./ryan-mono-bin.nix;
}

View file

@ -1,4 +1,4 @@
(_: prev: {
_: (_: prev: {
ibm-plex = prev.ibm-plex.overrideAttrs (_: {
postInstall = ''
set -eo pipefail

View file

@ -1,4 +1,4 @@
(_: prev: let
_: (_: prev: let
version = "2023.11.26";
mkFontVariant = {

View file

@ -1,58 +0,0 @@
{
pkgs,
inputs,
...
}: {
imports = [
./modules/nix.nix
./modules/packages.nix
./modules/homebrew.nix
];
system.activationScripts.extraActivation = {
text = ''
set -eo pipefail
HOME="/var/root" ${pkgs.lib.getExe pkgs.nvd} --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig"
'';
};
security.pam.enableSudoTouchIdAuth = true;
environment.customIcons = {
enable = true;
icons = [
{
path = "/Applications/Notion.app";
icon = ./icons/notion.icns;
}
{
path = "/Applications/Things.app";
icon = ./icons/things.icns;
}
{
path = "/Applications/Obsidian.app";
icon = ./icons/obsidian.icns;
}
];
};
programs.fish.enable = true;
programs.zsh.enable = true;
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit inputs;
};
users.ryanccn = import ./home;
};
users.users.ryanccn = {
home = "/Users/ryanccn";
};
system.stateVersion = 4;
}

View file

@ -0,0 +1,31 @@
{...}: {
security.pam.enableSudoTouchIdAuth = true;
environment.customIcons = {
enable = true;
icons = [
{
path = "/Applications/Notion.app";
icon = ../../icons/notion.icns;
}
{
path = "/Applications/Things.app";
icon = ../../icons/things.icns;
}
{
path = "/Applications/Obsidian.app";
icon = ../../icons/obsidian.icns;
}
];
};
programs.fish.enable = true;
programs.zsh.enable = true;
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
};
system.stateVersion = 4;
}