Migrate wg-rpi to flakes

This commit is contained in:
Vili Sinervä 2025-06-05 01:12:48 +03:00
parent 1ad87d46c6
commit d1f197d179
Signed by: Vili Sinervä
SSH key fingerprint: SHA256:FladqYjaE4scJY3Hi+gnShZ6ygnTJgixy0I6BAoHyos
2 changed files with 39 additions and 24 deletions

View file

@ -12,29 +12,43 @@
outputs = outputs =
{ nixpkgs, nixvim, ... }: { nixpkgs, nixvim, ... }:
{ {
nixosConfigurations = ( nixosConfigurations =
let (
hosts = builtins.attrNames (builtins.readDir ./hosts); let
in hosts = builtins.attrNames (builtins.readDir ./hosts);
builtins.listToAttrs ( in
map ( builtins.listToAttrs (
host: map (
nixpkgs.lib.nameValuePair host ( host:
nixpkgs.lib.nixosSystem { nixpkgs.lib.nameValuePair host (
specialArgs = { nixpkgs.lib.nixosSystem {
nixpkgs-flake = nixpkgs; specialArgs = {
inherit nixvim; nixpkgs-flake = nixpkgs;
}; inherit nixvim;
system = "x86_64-linux"; };
modules = [ system = "x86_64-linux";
{ networking.hostName = host; } modules = [
./hosts/${host}/configuration.nix { networking.hostName = host; }
./hosts/${host}/state.nix ./hosts/${host}/configuration.nix
]; ./hosts/${host}/state.nix
} ];
) }
) hosts )
) hosts
)
) )
); // {
wg-rpi = nixpkgs.lib.nixosSystem {
specialArgs = {
nixpkgs-flake = nixpkgs;
inherit nixvim;
};
system = "aarch64-linux";
modules = [
{ networking.hostName = "wg-rpi"; }
./hosts/special/wg-rpi/configuration.nix
];
};
};
}; };
} }

View file

@ -8,7 +8,7 @@ let
ddPassFile = "/root/wg-conf/ddPassFile"; ddPassFile = "/root/wg-conf/ddPassFile";
in in
{ {
imports = [ ../../shared/base.nix ]; imports = [ ../../../shared/base.nix ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
wireguard-tools wireguard-tools
@ -94,6 +94,7 @@ in
passwordFile = ddPassFile; passwordFile = ddPassFile;
}; };
#################### EVERYTHING BELOW THIS SHOULD NOT NEED TO CHANGE #################### #################### EVERYTHING BELOW THIS SHOULD NOT NEED TO CHANGE ####################
stateVersion = "24.11";
nix.settings = { nix.settings = {
cores = 3; cores = 3;