config-manager: Use nh os instead of nixos-rebuild

This commit is contained in:
Alexander Heldt
2023-10-15 18:12:14 +02:00
parent cc17483643
commit 611a1dbb12
4 changed files with 83 additions and 4 deletions

View File

@@ -15,7 +15,7 @@ Usage:
Flags:
--update updates the flake
--switch rebuilds + switches configuration
--switch rebuilds + switches configuration (using `nh`)
EOF
}
@@ -25,8 +25,7 @@ EOF
}
switch() {
echo -e "\033[0;31mREBUILDING + SWITCHING CONFIG\033[0m"
sudo nixos-rebuild switch --flake ${flakePath}#${nixosConfiguration}
nh os switch --ask --hostname ${nixosConfiguration} ${flakePath}
}
case $1 in

74
flake.lock generated
View File

@@ -66,6 +66,24 @@
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1693611461,
"narHash": "sha256-aPODl8vAgGQ0ZYFIRisxYG5MOGSkIczvu2Cd8Gb9+1Y=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "7f53fdb7bdc5bb237da7fefef12d099e4fd611ca",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
@@ -145,6 +163,43 @@
"type": "github"
}
},
"nh": {
"inputs": {
"flake-parts": "flake-parts",
"nix-filter": "nix-filter",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1696149398,
"narHash": "sha256-RwlAyww4bzeu2ndeQoScelYtlYiSxPdCn70R+xGdZBc=",
"owner": "viperML",
"repo": "nh",
"rev": "2985f5a45d6f3e1a9d8d3ca5c777ef1bc9c7fbd1",
"type": "github"
},
"original": {
"owner": "viperML",
"repo": "nh",
"type": "github"
}
},
"nix-filter": {
"locked": {
"lastModified": 1694857738,
"narHash": "sha256-bxxNyLHjhu0N8T3REINXQ2ZkJco0ABFPn6PIe2QUfqo=",
"owner": "numtide",
"repo": "nix-filter",
"rev": "41fd48e00c22b4ced525af521ead8792402de0ea",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "nix-filter",
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1696161939,
@@ -177,6 +232,24 @@
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1693471703,
"narHash": "sha256-0l03ZBL8P1P6z8MaSDS/MvuU8E75rVxe5eE1N6gxeTo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3e52e76b70d5508f3cec70b882a29199f4d1ee85",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1695825837,
@@ -215,6 +288,7 @@
"emacs-overlay": "emacs-overlay",
"home-manager": "home-manager_2",
"hyprland-contrib": "hyprland-contrib",
"nh": "nh",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
"nixpkgs2211": "nixpkgs2211"

View File

@@ -7,6 +7,11 @@
nixos-hardware.url = "github:nixos/nixos-hardware/master";
nh = {
url = "github:viperML/nh";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";

View File

@@ -90,6 +90,7 @@
environment.systemPackages = with pkgs; [
inputs.agenix.packages."${system}".default
inputs.nh.packages."${system}".default
coreutils
gnumake
bash