mirror of
https://github.com/ryanccn/flake.git
synced 2025-12-06 08:10:43 +01:00
refactor: split system into modules
This commit is contained in:
parent
3a7c130767
commit
8c087c0eb3
8 changed files with 182 additions and 164 deletions
36
flake.lock
generated
36
flake.lock
generated
|
|
@ -71,11 +71,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1692750383,
|
||||
"narHash": "sha256-n5P5HOXuu23UB1h9PuayldnRRVQuXJLpoO+xqtMO3ws=",
|
||||
"lastModified": 1693163878,
|
||||
"narHash": "sha256-HXuyMUVaRSoIA602jfFuYGXt6AMZ+WUxuvLq8iJmYTA=",
|
||||
"owner": "ipetkov",
|
||||
"repo": "crane",
|
||||
"rev": "ef5d11e3c2e5b3924eb0309dba2e1fea2d9062ae",
|
||||
"rev": "43db881168bc65b568d36ceb614a0fc8b276191b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -86,11 +86,11 @@
|
|||
},
|
||||
"darwin-custom-icons": {
|
||||
"locked": {
|
||||
"lastModified": 1693056564,
|
||||
"narHash": "sha256-hFZVorJ0jdTDqM0DKArtOyMIxVX14oNpqG+58j3WLKg=",
|
||||
"lastModified": 1693410124,
|
||||
"narHash": "sha256-DXjBumqDVHoTgB4JOZeDWMhYpgHmk9qoSziYFLclfL0=",
|
||||
"owner": "ryanccn",
|
||||
"repo": "nix-darwin-custom-icons",
|
||||
"rev": "7001db539da6247a18e9021c2d387f72db005466",
|
||||
"rev": "9095bdc551000d789ea0e829c98ec3d5c7a9e9d9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -106,11 +106,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1692089279,
|
||||
"narHash": "sha256-4OcROiMbf+YF41n+KPx3cqiHs2KoY7pdDGyCvJow1p8=",
|
||||
"lastModified": 1693198521,
|
||||
"narHash": "sha256-xhH3T6j9JvT1UDLM1QJmtwrjJpA4MoZx2hPxJLrin7w=",
|
||||
"owner": "ryanccn",
|
||||
"repo": "discord-applemusic-rich-presence",
|
||||
"rev": "f257c32c794ef6b09cddcaaa7be27a1f74d9683d",
|
||||
"rev": "42d98b6d99a32ca5075b10c61e3446af97af7c8f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -160,11 +160,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1692763155,
|
||||
"narHash": "sha256-qMrGKZ8c/q/mHO3ZdrcBPwiVVXPLLgXjY98Ejqb5kAA=",
|
||||
"lastModified": 1693399033,
|
||||
"narHash": "sha256-yXhiMo8MnE86sGtPIHAKaLHhmhe8v9tqGGotlUgKJvY=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "6a20e40acaebf067da682661aa67da8b36812606",
|
||||
"rev": "f5c15668f9842dd4d5430787d6aa8a28a07f7c10",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -195,11 +195,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1692934111,
|
||||
"narHash": "sha256-9EEE59v/esKNMR5zKbLRV9NoRPYvERw5jHQOnfr47bk=",
|
||||
"lastModified": 1693355128,
|
||||
"narHash": "sha256-+ZoAny3ZxLcfMaUoLVgL9Ywb/57wP+EtsdNGuXUJrwg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "1e44a037bbf4fcaba041436e65e87be88f3f495b",
|
||||
"rev": "a63a64b593dcf2fe05f7c5d666eb395950f36bc9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -262,11 +262,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1693015707,
|
||||
"narHash": "sha256-SFr93DYn502sVT9nB5U8/cKg1INyEk/jCeq8tHioz7Y=",
|
||||
"lastModified": 1693361441,
|
||||
"narHash": "sha256-TRFdMQj9wSKMduNqe/1xF8TzcPWEdcn/hKWcVcZ5fO8=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "e90223633068a44f0fb62374e0fa360ccc987292",
|
||||
"rev": "1fb2aa49635e9f30b6fa211ab7c454f7175e1ba3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
|
|
@ -58,7 +58,9 @@
|
|||
inputs.flake-compat.follows = "flake-compat";
|
||||
};
|
||||
|
||||
darwin-custom-icons.url = "github:ryanccn/nix-darwin-custom-icons";
|
||||
darwin-custom-icons = {
|
||||
url = "github:ryanccn/nix-darwin-custom-icons";
|
||||
};
|
||||
|
||||
flake-utils = {
|
||||
url = "github:numtide/flake-utils";
|
||||
|
|
@ -83,12 +85,9 @@
|
|||
home-manager.darwinModules.home-manager
|
||||
darwin-custom-icons.darwinModules.default
|
||||
./system.nix
|
||||
./users.nix
|
||||
];
|
||||
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
};
|
||||
specialArgs = {inherit inputs;};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
31
modules/homebrew.nix
Normal file
31
modules/homebrew.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
_: {
|
||||
environment.variables = {
|
||||
HOMEBREW_NO_ANALYTICS = "1";
|
||||
HOMEBREW_NO_INSECURE_REDIRECT = "1";
|
||||
HOMEBREW_NO_EMOJI = "1";
|
||||
};
|
||||
|
||||
homebrew = {
|
||||
enable = true;
|
||||
caskArgs.require_sha = true;
|
||||
onActivation = {
|
||||
autoUpdate = true;
|
||||
cleanup = "uninstall";
|
||||
upgrade = true;
|
||||
};
|
||||
|
||||
casks = let
|
||||
noQuarantine = name: {
|
||||
inherit name;
|
||||
args = {no_quarantine = true;};
|
||||
};
|
||||
in [
|
||||
"blackhole-16ch"
|
||||
(noQuarantine "eloston-chromium")
|
||||
"sf-symbols"
|
||||
"1password/tap/1password-cli"
|
||||
];
|
||||
|
||||
taps = ["1password/tap"];
|
||||
};
|
||||
}
|
||||
35
modules/nix.nix
Normal file
35
modules/nix.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
services.nix-daemon.enable = true;
|
||||
nix.package = pkgs.nix;
|
||||
|
||||
nix.settings = {
|
||||
experimental-features = "nix-command flakes";
|
||||
build-users-group = "nixbld";
|
||||
trusted-users = ["ryanccn"];
|
||||
auto-optimise-store = true;
|
||||
extra-platforms = ["x86_64-darwin" "aarch64-darwin"];
|
||||
|
||||
extra-substituters = [
|
||||
"https://nix-community.cachix.org"
|
||||
];
|
||||
extra-trusted-public-keys = [
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
];
|
||||
};
|
||||
|
||||
nixpkgs = {
|
||||
overlays = [
|
||||
inputs.attic.overlays.default
|
||||
inputs.discord-applemusic-rich-presence.overlays.default
|
||||
inputs.nyoom.overlays.default
|
||||
(import ../overlays/ryan-mono-bin.nix)
|
||||
];
|
||||
|
||||
config.allowUnfree = true;
|
||||
hostPlatform = "aarch64-darwin";
|
||||
};
|
||||
}
|
||||
75
modules/packages.nix
Normal file
75
modules/packages.nix
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
nil
|
||||
statix
|
||||
alejandra
|
||||
nixpkgs-fmt
|
||||
|
||||
nix-melt
|
||||
attic-client
|
||||
cachix
|
||||
direnv
|
||||
|
||||
rustc
|
||||
cargo
|
||||
sccache
|
||||
|
||||
fnm
|
||||
deno
|
||||
bun
|
||||
|
||||
(python311.withPackages (ps: with ps; [pip]))
|
||||
yt-dlp
|
||||
xkcdpass
|
||||
pipreqs
|
||||
|
||||
libffi
|
||||
openssl
|
||||
|
||||
rust-analyzer
|
||||
nodePackages.typescript-language-server
|
||||
rustfmt
|
||||
clippy
|
||||
dprint
|
||||
|
||||
age
|
||||
bat
|
||||
btop
|
||||
cloudflared
|
||||
doggo
|
||||
doppler
|
||||
du-dust
|
||||
fd
|
||||
ffmpeg
|
||||
flyctl
|
||||
fzf
|
||||
gh
|
||||
gen-license
|
||||
gum
|
||||
hyperfine
|
||||
jq
|
||||
just
|
||||
mkcert
|
||||
nerdfix
|
||||
pscale
|
||||
railway
|
||||
ripgrep
|
||||
silicon
|
||||
tealdeer
|
||||
tokei
|
||||
vhs
|
||||
vivid
|
||||
watchexec
|
||||
xh
|
||||
zoxide
|
||||
|
||||
typst
|
||||
|
||||
packwiz
|
||||
catppuccin-catwalk
|
||||
|
||||
nyoom
|
||||
spicetify-cli
|
||||
exiftool
|
||||
];
|
||||
}
|
||||
|
|
@ -4,8 +4,8 @@ _: {
|
|||
goPath = ".go";
|
||||
};
|
||||
|
||||
home.file."Library/Application Support/go/env".text = ''
|
||||
GOTOOLCHAIN=path
|
||||
GOPROXY=direct
|
||||
'';
|
||||
home.sessionVariables = {
|
||||
GOTOOLCHAIN = "path";
|
||||
GOPROXY = "direct";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
135
system.nix
135
system.nix
|
|
@ -3,109 +3,12 @@
|
|||
inputs,
|
||||
...
|
||||
}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
nil
|
||||
alejandra
|
||||
nixpkgs-fmt
|
||||
attic-client
|
||||
statix
|
||||
cachix
|
||||
direnv
|
||||
|
||||
rustc
|
||||
cargo
|
||||
|
||||
sccache
|
||||
deno
|
||||
fnm
|
||||
bun
|
||||
|
||||
(python311.withPackages (ps:
|
||||
with ps; [
|
||||
pip
|
||||
yt-dlp
|
||||
xkcdpass
|
||||
]))
|
||||
libffi
|
||||
openssl
|
||||
|
||||
rust-analyzer
|
||||
nodePackages.typescript-language-server
|
||||
rustfmt
|
||||
clippy
|
||||
dprint
|
||||
|
||||
age
|
||||
bat
|
||||
btop
|
||||
cloudflared
|
||||
doggo
|
||||
doppler
|
||||
du-dust
|
||||
fd
|
||||
ffmpeg
|
||||
flyctl
|
||||
fzf
|
||||
gh
|
||||
gen-license
|
||||
gum
|
||||
hyperfine
|
||||
jq
|
||||
just
|
||||
mkcert
|
||||
nerdfix
|
||||
pscale
|
||||
railway
|
||||
ripgrep
|
||||
silicon
|
||||
tealdeer
|
||||
tokei
|
||||
vhs
|
||||
vivid
|
||||
watchexec
|
||||
xh
|
||||
zoxide
|
||||
|
||||
typst
|
||||
|
||||
packwiz
|
||||
catppuccin-catwalk
|
||||
|
||||
nyoom
|
||||
spicetify-cli
|
||||
exiftool
|
||||
imports = [
|
||||
./modules/nix.nix
|
||||
./modules/packages.nix
|
||||
./modules/homebrew.nix
|
||||
];
|
||||
|
||||
services.nix-daemon.enable = true;
|
||||
nix.package = pkgs.nix;
|
||||
|
||||
nix.settings = {
|
||||
experimental-features = "nix-command flakes";
|
||||
build-users-group = "nixbld";
|
||||
trusted-users = ["ryanccn"];
|
||||
auto-optimise-store = true;
|
||||
extra-platforms = ["x86_64-darwin" "aarch64-darwin"];
|
||||
|
||||
extra-substituters = [
|
||||
"https://nix-community.cachix.org"
|
||||
];
|
||||
extra-trusted-public-keys = [
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
];
|
||||
};
|
||||
|
||||
nixpkgs = {
|
||||
overlays = [
|
||||
inputs.attic.overlays.default
|
||||
inputs.discord-applemusic-rich-presence.overlays.default
|
||||
inputs.nyoom.overlays.default
|
||||
(import ./overlays/ryan-mono-bin.nix)
|
||||
];
|
||||
|
||||
config.allowUnfree = true;
|
||||
hostPlatform = "aarch64-darwin";
|
||||
};
|
||||
|
||||
system.activationScripts.extraActivation = {
|
||||
text = ''
|
||||
set -eo pipefail
|
||||
|
|
@ -128,28 +31,20 @@
|
|||
programs.fish.enable = true;
|
||||
programs.zsh.enable = true;
|
||||
|
||||
homebrew = {
|
||||
enable = true;
|
||||
caskArgs.require_sha = true;
|
||||
onActivation = {
|
||||
autoUpdate = true;
|
||||
cleanup = "uninstall";
|
||||
upgrade = true;
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
|
||||
extraSpecialArgs = {
|
||||
ctpModule = inputs.catppuccin.homeManagerModules.catppuccin;
|
||||
discord-applemusic-rich-presence = inputs.discord-applemusic-rich-presence.homeManagerModules.default;
|
||||
};
|
||||
|
||||
casks = let
|
||||
noQuarantine = name: {
|
||||
inherit name;
|
||||
args = {no_quarantine = true;};
|
||||
};
|
||||
in [
|
||||
"blackhole-16ch"
|
||||
(noQuarantine "eloston-chromium")
|
||||
"sf-symbols"
|
||||
"1password/tap/1password-cli"
|
||||
];
|
||||
users.ryanccn = import ./home.nix;
|
||||
};
|
||||
|
||||
taps = ["1password/tap"];
|
||||
users.users.ryanccn = {
|
||||
home = "/Users/ryanccn";
|
||||
};
|
||||
|
||||
system.stateVersion = 4;
|
||||
|
|
|
|||
17
users.nix
17
users.nix
|
|
@ -1,17 +0,0 @@
|
|||
{inputs, ...}: {
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
|
||||
extraSpecialArgs = {
|
||||
ctpModule = inputs.catppuccin.homeManagerModules.catppuccin;
|
||||
discord-applemusic-rich-presence = inputs.discord-applemusic-rich-presence.homeManagerModules.default;
|
||||
};
|
||||
|
||||
users.ryanccn = import ./home.nix;
|
||||
};
|
||||
|
||||
users.users.ryanccn = {
|
||||
home = "/Users/ryanccn";
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue