This commit is contained in:
2025-05-05 22:54:06 +02:00
parent d8b75fc8b4
commit ff07a08b78
11 changed files with 152 additions and 27 deletions

View File

@@ -4,7 +4,7 @@ all:
echo "No command provided"
switch:
sudo nixos-rebuild switch --flake ".#${HOSTNAME}"
nixos-rebuild switch --flake ".#${HOSTNAME}" --use-remote-sudo
test:
sudo nixos-rebuild test --flake ".#${HOSTNAME}"
nixos-rebuild test --flake ".#${HOSTNAME}" --use-remote-sudo

128
flake.lock generated
View File

@@ -59,6 +59,68 @@
"type": "github"
}
},
"home-manager-stable-darwin": {
"inputs": {
"nixpkgs": [
"nixpkgs-stable-darwin"
]
},
"locked": {
"lastModified": 1746171682,
"narHash": "sha256-EyXUNSa+H+YvGVuQJP1nZskXAowxKYp79RNUsNdQTj4=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "50eee705bbdbac942074a8c120e8194185633675",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-24.11",
"repo": "home-manager",
"type": "github"
}
},
"home-manager-stable-nixos": {
"inputs": {
"nixpkgs": [
"nixpkgs-stable-nixos"
]
},
"locked": {
"lastModified": 1746171682,
"narHash": "sha256-EyXUNSa+H+YvGVuQJP1nZskXAowxKYp79RNUsNdQTj4=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "50eee705bbdbac942074a8c120e8194185633675",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-24.11",
"repo": "home-manager",
"type": "github"
}
},
"home-manager-unstable": {
"inputs": {
"nixpkgs": [
"nixpkgs-unstable"
]
},
"locked": {
"lastModified": 1746413188,
"narHash": "sha256-i6BoiQP0PasExESQHszC0reQHfO6D4aI2GzOwZMOI20=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "8a318641ac13d3bc0a53651feaee9560f9b2d89a",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"ixx": {
"inputs": {
"flake-utils": [
@@ -89,16 +151,64 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1746232882,
"narHash": "sha256-MHmBH2rS8KkRRdoU/feC/dKbdlMkcNkB5mwkuipVHeQ=",
"owner": "NixOS",
"lastModified": 1746397377,
"narHash": "sha256-5oLdRa3vWSRbuqPIFFmQBGGUqaYZBxX+GGtN9f/n4lU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "7a2622e2c0dbad5c4493cb268aba12896e28b008",
"rev": "ed30f8aba41605e3ab46421e3dcb4510ec560ff8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable-darwin": {
"locked": {
"lastModified": 1746301764,
"narHash": "sha256-5odz+NZszRya//Zd0P8h+sIwOnV35qJi+73f4I+iv1M=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "537ee98218704e21ea465251de512ab6bbb9012e",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-24.11-darwin",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable-nixos": {
"locked": {
"lastModified": 1746422338,
"narHash": "sha256-NTtKOTLQv6dPfRe00OGSywg37A1FYqldS6xiNmqBUYc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "5b35d248e9206c1f3baf8de6a7683fee126364aa",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1746397377,
"narHash": "sha256-5oLdRa3vWSRbuqPIFFmQBGGUqaYZBxX+GGtN9f/n4lU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "ed30f8aba41605e3ab46421e3dcb4510ec560ff8",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
@@ -151,7 +261,13 @@
"root": {
"inputs": {
"home-manager": "home-manager",
"home-manager-stable-darwin": "home-manager-stable-darwin",
"home-manager-stable-nixos": "home-manager-stable-nixos",
"home-manager-unstable": "home-manager-unstable",
"nixpkgs": "nixpkgs",
"nixpkgs-stable-darwin": "nixpkgs-stable-darwin",
"nixpkgs-stable-nixos": "nixpkgs-stable-nixos",
"nixpkgs-unstable": "nixpkgs-unstable",
"nixvim": "nixvim"
}
},

View File

@@ -1,6 +1,22 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixpkgs-stable-nixos.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs-stable-darwin.url = "github:nixos/nixpkgs/nixpkgs-24.11-darwin";
home-manager-unstable = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
home-manager-stable-nixos = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs-stable-nixos";
};
home-manager-stable-darwin = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs-stable-darwin";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
@@ -18,6 +34,7 @@
mkSystem = import ./lib/mksystem.nix {
inherit
overlays
nixvim
inputs;
};
in

View File

@@ -1,6 +1,7 @@
# This file comes from https://github.com/kahlstrm/nixos-config/blob/main/lib/mksystem.nix
{
overlays,
nixvim,
inputs,
}:
name:
@@ -31,7 +32,7 @@ let
;
# The config files for this system.
nixConfig = ../modules/nix-config/default.nix;
machineConfig = ../machines/${name}.nix;
machineConfig = ../machines/${name}/default.nix;
# OSConfig = ../modules/${if isDarwin then "darwin" else "nixos"}.nix;
HMConfig = ../home;
# systemPackages = ../modules/packages.nix;
@@ -68,31 +69,22 @@ in
assert isWSL -> !isDarwin;
systemFunc {
inherit system specialArgs;
# We expose some extra arguments so that our modules can parameterize
# better based on these values.
modules = [
# Apply our overlays. Overlays are keyed by system type so we have
# to go through and apply our system type. We do this first so
# the overlays are available globally.
{ nixpkgs.overlays = overlays; }
# Allow unfree packages.
{ nixpkgs.config.allowUnfree = true; }
# Bring in WSL if this is a WSL build
(if isWSL then inputs.nixos-wsl.nixosModules.wsl else { })
nixConfig
nix-homebrew
nix-homebrew-config
# systemPackages
# OSConfig
# TODO: make user config & home-manager optional
home-manager.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${user} = import HMConfig;
home-manager.extraSpecialArgs = specialArgs;
home-manager.sharedModules = [
nixvim.homeManagerModules.nixvim
];
}
machineConfig
];

View File

@@ -6,11 +6,9 @@
let
isDarwin = (import inputs.nixpkgs-unstable { inherit system; }).stdenv.isDarwin;
darwin = if stable then inputs.darwin-stable else inputs.darwin-unstable;
stable-suffix = if isDarwin then "stable-darwin" else "stable-nixos";
nixpkgs-stable = inputs."nixpkgs-${stable-suffix}";
nixpkgs-stable = inputs."nixpkgs-unstable";
nixpkgs = if stable then nixpkgs-stable else inputs.nixpkgs-unstable;
home-manager =
if stable then inputs."home-manager-${stable-suffix}" else inputs.home-manager-unstable;
home-manager = inputs.home-manager-unstable;
in
{
inherit isDarwin nixpkgs-stable;

View File

@@ -2,6 +2,7 @@
{
imports = [
./hardware/katana.nix
../modules
];
system.stateVersion = "24.05"; # Did you read the comment?

View File

@@ -1,6 +1,7 @@
{ ... }:
{
imports = [
./hardware.nix
./boot.nix
./nvidia.nix
./services.nix