mirror of
https://github.com/davegallant/nix-config
synced 2025-08-11 20:32:27 +00:00
Compare commits
3 Commits
114d75da7f
...
b1ca4fc2ef
Author | SHA1 | Date | |
---|---|---|---|
|
b1ca4fc2ef | ||
|
ecf9637673 | ||
|
130b7603da |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,3 @@
|
|||||||
.pre-commit-config.yaml
|
.pre-commit-config.yaml
|
||||||
.vscode
|
.vscode
|
||||||
git-crypt-key
|
|
||||||
result
|
result
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
# nix-config
|
# nix-config
|
||||||
|
|
||||||
This repo stores nix configuration to manage my machines running [NixOS](https://nixos.org/) and macOS.
|
This repo stores nix configuration to manage my hosts running [NixOS](https://nixos.org/) and macOS.
|
||||||
|
|
||||||
The configuration is very specific to my own machines and setup, but it may be a useful reference for anyone else learning or experimenting with nix, whether it be on a personal workstation or a server environment.
|
The configuration is very specific to my own machines and setup, but it may be a useful reference for anyone else learning or experimenting with nix, whether it be on a personal workstation or a server environment.
|
||||||
|
|
||||||
@@ -45,4 +45,4 @@ just clean
|
|||||||
|
|
||||||
## Pre-commit hooks
|
## Pre-commit hooks
|
||||||
|
|
||||||
Pre-commit hooks are automatically activated when [direnv](https://github.com/direnv/direnv) is installed.
|
Run `nix develop` to install the pre-commit hooks.
|
||||||
|
13
default.nix
13
default.nix
@@ -1,13 +0,0 @@
|
|||||||
let
|
|
||||||
nix-pre-commit-hooks = import (
|
|
||||||
builtins.fetchTarball "https://github.com/cachix/git-hooks.nix/tarball/master"
|
|
||||||
);
|
|
||||||
in
|
|
||||||
{
|
|
||||||
pre-commit-check = nix-pre-commit-hooks.run {
|
|
||||||
src = ./.;
|
|
||||||
hooks = {
|
|
||||||
shellcheck.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
84
flake.lock
generated
84
flake.lock
generated
@@ -257,6 +257,22 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-compat_3": {
|
"flake-compat_3": {
|
||||||
|
"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-compat_4": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1733328505,
|
"lastModified": 1733328505,
|
||||||
@@ -455,7 +471,7 @@
|
|||||||
"stylix",
|
"stylix",
|
||||||
"flake-compat"
|
"flake-compat"
|
||||||
],
|
],
|
||||||
"gitignore": "gitignore_2",
|
"gitignore": "gitignore_3",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"stylix",
|
"stylix",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
@@ -498,6 +514,27 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"gitignore_2": {
|
"gitignore_2": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"pre-commit-hooks",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1709087332,
|
||||||
|
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"gitignore_3": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"stylix",
|
"stylix",
|
||||||
@@ -810,6 +847,22 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_6": {
|
"nixpkgs_6": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1730768919,
|
||||||
|
"narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_7": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1743703532,
|
"lastModified": 1743703532,
|
||||||
"narHash": "sha256-s1KLDALEeqy+ttrvqV3jx9mBZEvmthQErTVOAzbjHZs=",
|
"narHash": "sha256-s1KLDALEeqy+ttrvqV3jx9mBZEvmthQErTVOAzbjHZs=",
|
||||||
@@ -825,7 +878,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_7": {
|
"nixpkgs_8": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1743814133,
|
"lastModified": 1743814133,
|
||||||
"narHash": "sha256-drDyYyUmjeYGiHmwB9eOPTQRjmrq3Yz26knwmMPLZFk=",
|
"narHash": "sha256-drDyYyUmjeYGiHmwB9eOPTQRjmrq3Yz26knwmMPLZFk=",
|
||||||
@@ -893,6 +946,26 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"pre-commit-hooks": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat_3",
|
||||||
|
"gitignore": "gitignore_2",
|
||||||
|
"nixpkgs": "nixpkgs_6"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1742649964,
|
||||||
|
"narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "git-hooks.nix",
|
||||||
|
"rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "git-hooks.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"darwin": "darwin",
|
"darwin": "darwin",
|
||||||
@@ -902,6 +975,7 @@
|
|||||||
"nixpkgs": "nixpkgs_5",
|
"nixpkgs": "nixpkgs_5",
|
||||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||||
"nixvim": "nixvim",
|
"nixvim": "nixvim",
|
||||||
|
"pre-commit-hooks": "pre-commit-hooks",
|
||||||
"stylix": "stylix",
|
"stylix": "stylix",
|
||||||
"vpngate": "vpngate"
|
"vpngate": "vpngate"
|
||||||
}
|
}
|
||||||
@@ -930,12 +1004,12 @@
|
|||||||
"base16-helix": "base16-helix",
|
"base16-helix": "base16-helix",
|
||||||
"base16-vim": "base16-vim",
|
"base16-vim": "base16-vim",
|
||||||
"firefox-gnome-theme": "firefox-gnome-theme",
|
"firefox-gnome-theme": "firefox-gnome-theme",
|
||||||
"flake-compat": "flake-compat_3",
|
"flake-compat": "flake-compat_4",
|
||||||
"flake-utils": "flake-utils_2",
|
"flake-utils": "flake-utils_2",
|
||||||
"git-hooks": "git-hooks_2",
|
"git-hooks": "git-hooks_2",
|
||||||
"gnome-shell": "gnome-shell",
|
"gnome-shell": "gnome-shell",
|
||||||
"home-manager": "home-manager_3",
|
"home-manager": "home-manager_3",
|
||||||
"nixpkgs": "nixpkgs_6",
|
"nixpkgs": "nixpkgs_7",
|
||||||
"systems": "systems_2",
|
"systems": "systems_2",
|
||||||
"tinted-foot": "tinted-foot",
|
"tinted-foot": "tinted-foot",
|
||||||
"tinted-kitty": "tinted-kitty",
|
"tinted-kitty": "tinted-kitty",
|
||||||
@@ -1075,7 +1149,7 @@
|
|||||||
"vpngate": {
|
"vpngate": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils_3",
|
"flake-utils": "flake-utils_3",
|
||||||
"nixpkgs": "nixpkgs_7"
|
"nixpkgs": "nixpkgs_8"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1743991519,
|
"lastModified": 1743991519,
|
||||||
|
34
flake.nix
34
flake.nix
@@ -6,6 +6,7 @@
|
|||||||
fh.url = "https://flakehub.com/f/DeterminateSystems/fh/*";
|
fh.url = "https://flakehub.com/f/DeterminateSystems/fh/*";
|
||||||
nixpkgs-unstable.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
|
nixpkgs-unstable.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
|
||||||
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*";
|
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*";
|
||||||
|
pre-commit-hooks.url = "github:cachix/git-hooks.nix";
|
||||||
darwin = {
|
darwin = {
|
||||||
url = "github:lnl7/nix-darwin/nix-darwin-24.11";
|
url = "github:lnl7/nix-darwin/nix-darwin-24.11";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@@ -21,6 +22,7 @@
|
|||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
{
|
{
|
||||||
|
self,
|
||||||
darwin,
|
darwin,
|
||||||
fh,
|
fh,
|
||||||
determinate,
|
determinate,
|
||||||
@@ -31,7 +33,31 @@
|
|||||||
vpngate,
|
vpngate,
|
||||||
...
|
...
|
||||||
}@inputs:
|
}@inputs:
|
||||||
|
let
|
||||||
|
supportedSystems = [
|
||||||
|
"x86_64-linux"
|
||||||
|
"aarch64-linux"
|
||||||
|
"x86_64-darwin"
|
||||||
|
"aarch64-darwin"
|
||||||
|
];
|
||||||
|
|
||||||
|
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
|
checks = forAllSystems (system: {
|
||||||
|
pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
|
||||||
|
src = ./.;
|
||||||
|
hooks = {
|
||||||
|
nixfmt-rfc-style.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
devShells = forAllSystems (system: {
|
||||||
|
default = nixpkgs.legacyPackages.${system}.mkShell {
|
||||||
|
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
||||||
|
buildInputs = self.checks.${system}.pre-commit-check.enabledPackages;
|
||||||
|
};
|
||||||
|
});
|
||||||
nixosConfigurations =
|
nixosConfigurations =
|
||||||
let
|
let
|
||||||
unstable = import nixpkgs-unstable {
|
unstable = import nixpkgs-unstable {
|
||||||
@@ -48,7 +74,7 @@
|
|||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
./fonts.nix
|
./fonts.nix
|
||||||
./machines/hephaestus/configuration.nix
|
./hosts/hephaestus/configuration.nix
|
||||||
./packages.nix
|
./packages.nix
|
||||||
./services/netdata/default.nix
|
./services/netdata/default.nix
|
||||||
./upgrade-diff.nix
|
./upgrade-diff.nix
|
||||||
@@ -68,7 +94,9 @@
|
|||||||
"root"
|
"root"
|
||||||
"dave"
|
"dave"
|
||||||
];
|
];
|
||||||
trusted-public-keys = [ "davegallant.cachix.org-1:SsUMqL4+tF2R3/G6X903E9laLlY1rES2QKFfePegF08=" ];
|
trusted-public-keys = [
|
||||||
|
"davegallant.cachix.org-1:SsUMqL4+tF2R3/G6X903E9laLlY1rES2QKFfePegF08="
|
||||||
|
];
|
||||||
};
|
};
|
||||||
registry = {
|
registry = {
|
||||||
nixpkgs.flake = nixpkgs;
|
nixpkgs.flake = nixpkgs;
|
||||||
@@ -118,7 +146,7 @@
|
|||||||
modules = [
|
modules = [
|
||||||
home-manager.darwinModules.home-manager
|
home-manager.darwinModules.home-manager
|
||||||
stylix.darwinModules.stylix
|
stylix.darwinModules.stylix
|
||||||
./machines/zelus/configuration.nix
|
./hosts/zelus/configuration.nix
|
||||||
./packages.nix
|
./packages.nix
|
||||||
./upgrade-diff.nix
|
./upgrade-diff.nix
|
||||||
|
|
||||||
|
@@ -387,7 +387,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
vscode = {
|
vscode = {
|
||||||
enable = true;
|
enable = stdenv.isLinux;
|
||||||
package = pkgs.vscode;
|
package = pkgs.vscode;
|
||||||
extensions =
|
extensions =
|
||||||
with pkgs.vscode-extensions;
|
with pkgs.vscode-extensions;
|
||||||
|
@@ -48,15 +48,23 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
NSGlobalDomain = {
|
NSGlobalDomain.AppleShowAllExtensions = true;
|
||||||
"com.apple.sound.beep.feedback" = 0;
|
NSGlobalDomain.AppleShowScrollBars = "Always";
|
||||||
"com.apple.sound.beep.volume" = 0.0;
|
NSGlobalDomain.NSUseAnimatedFocusRing = false;
|
||||||
ApplePressAndHoldEnabled = false;
|
NSGlobalDomain.NSNavPanelExpandedStateForSaveMode = true;
|
||||||
InitialKeyRepeat = 10;
|
NSGlobalDomain.NSNavPanelExpandedStateForSaveMode2 = true;
|
||||||
KeyRepeat = 2;
|
NSGlobalDomain.PMPrintingExpandedStateForPrint = true;
|
||||||
AppleShowAllExtensions = true;
|
NSGlobalDomain.PMPrintingExpandedStateForPrint2 = true;
|
||||||
AppleShowScrollBars = "Automatic";
|
NSGlobalDomain.NSDocumentSaveNewDocumentsToCloud = false;
|
||||||
};
|
NSGlobalDomain.ApplePressAndHoldEnabled = false;
|
||||||
|
NSGlobalDomain.InitialKeyRepeat = 25;
|
||||||
|
NSGlobalDomain.KeyRepeat = 2;
|
||||||
|
NSGlobalDomain."com.apple.mouse.tapBehavior" = 1;
|
||||||
|
NSGlobalDomain.NSWindowShouldDragOnGesture = true;
|
||||||
|
NSGlobalDomain.NSAutomaticSpellingCorrectionEnabled = false;
|
||||||
|
LaunchServices.LSQuarantine = false; # disables "Are you sure?" for new apps
|
||||||
|
loginwindow.GuestEnabled = false;
|
||||||
|
finder.FXPreferredViewStyle = "Nlsv";
|
||||||
};
|
};
|
||||||
|
|
||||||
security.pam.enableSudoTouchIdAuth = true;
|
security.pam.enableSudoTouchIdAuth = true;
|
||||||
@@ -77,7 +85,6 @@
|
|||||||
"coreutils"
|
"coreutils"
|
||||||
"gnu-sed"
|
"gnu-sed"
|
||||||
"gnu-tar"
|
"gnu-tar"
|
||||||
"netdata"
|
|
||||||
"node"
|
"node"
|
||||||
"oras"
|
"oras"
|
||||||
"k6"
|
"k6"
|
||||||
@@ -99,7 +106,6 @@
|
|||||||
"mitmproxy"
|
"mitmproxy"
|
||||||
"notunes"
|
"notunes"
|
||||||
"ollama"
|
"ollama"
|
||||||
"postman"
|
|
||||||
"raycast"
|
"raycast"
|
||||||
"rectangle"
|
"rectangle"
|
||||||
"signal"
|
"signal"
|
2
justfile
2
justfile
@@ -8,7 +8,7 @@ arch := `uname -s`
|
|||||||
cmd := if arch == "Linux" { "sudo nixos-rebuild --use-remote-sudo" } else { "darwin-rebuild" }
|
cmd := if arch == "Linux" { "sudo nixos-rebuild --use-remote-sudo" } else { "darwin-rebuild" }
|
||||||
|
|
||||||
rebuild:
|
rebuild:
|
||||||
$cmd switch --flake . -I nixos-config="machines/$(hostname)/configuration.nix"
|
$cmd switch --flake . -I nixos-config="hosts/$(hostname)/configuration.nix"
|
||||||
|
|
||||||
rollback:
|
rollback:
|
||||||
$cmd switch --rollback --flake .
|
$cmd switch --rollback --flake .
|
||||||
|
Reference in New Issue
Block a user