[lucia] remove old approach and build baseimg using nixos-generators

This commit is contained in:
2022-11-22 19:47:01 +01:00
parent b34e473865
commit f5a36cbb7a
4 changed files with 59 additions and 12 deletions

37
flake.lock generated
View File

@@ -40,6 +40,42 @@
"type": "github" "type": "github"
} }
}, },
"nixlib": {
"locked": {
"lastModified": 1636849918,
"narHash": "sha256-nzUK6dPcTmNVrgTAC1EOybSMsrcx+QrVPyqRdyKLkjA=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "28a5b0557f14124608db68d3ee1f77e9329e9dd5",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixos-generators": {
"inputs": {
"nixlib": "nixlib",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1669065280,
"narHash": "sha256-3+pq1oJWjGDLfd8G/vR3IIFZ+EQ/aglukA0bTiMlf3o=",
"owner": "nix-community",
"repo": "nixos-generators",
"rev": "50aeec40f2072d2ab267c8ec8a345573704ec110",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixos-generators",
"type": "github"
}
},
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1664628729, "lastModified": 1664628729,
@@ -124,6 +160,7 @@
"inputs": { "inputs": {
"home-manager": "home-manager", "home-manager": "home-manager",
"mfsync": "mfsync", "mfsync": "mfsync",
"nixos-generators": "nixos-generators",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",

View File

@@ -10,6 +10,11 @@
sops-nix.inputs.nixpkgs.follows = "nixpkgs"; sops-nix.inputs.nixpkgs.follows = "nixpkgs";
mfsync.url = "github:k4lipso/mfsync"; mfsync.url = "github:k4lipso/mfsync";
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager= { home-manager= {
url = "github:nix-community/home-manager/release-22.05"; url = "github:nix-community/home-manager/release-22.05";
inputs = { inputs = {

View File

@@ -37,20 +37,11 @@ in
]; ];
}; };
rpi1_base_image = nixosSystem { lucia = nixosSystem {
system = "aarch64-linux"; system = "aarch64-linux";
specialArgs.inputs = inputs;
modules = [ modules = [
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-raspberrypi.nix" ./lucia/configuration.nix
./modules/sshd.nix
{
nixpkgs.config.allowUnsupportedSystem = true;
nixpkgs.crossSystem.system = "aarch64-linux";
networking.hostName = "rp1_base_image";
networking.networkmanager.enable = true;
system.stateVersion = "22.05";
}
]; ];
}; };
} }

View File

@@ -2,6 +2,7 @@
, utils , utils
, nixpkgs , nixpkgs
, nixpkgs-unstable , nixpkgs-unstable
, nixos-generators
, sops-nix , sops-nix
, ... , ...
} @inputs: } @inputs:
@@ -23,4 +24,17 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems
}); });
images.rpi1_base_image = nixosConfigurations.rpi1_base_image.config.system.build.sdImage; images.rpi1_base_image = nixosConfigurations.rpi1_base_image.config.system.build.sdImage;
packages.x86_64-linux = {
lucia_base_img = nixos-generators.nixosGenerate {
system = "aarch64-linux";
modules = [
./machines/modules/sshd.nix
{
networking.networkmanager.enable = true;
}
];
format = "sd-aarch64-installer";
};
};
} }