start generator work

This commit is contained in:
Noah Masur 2022-09-20 04:01:45 +00:00
parent 6281e32275
commit 50a538c78e
3 changed files with 73 additions and 3 deletions

View File

@ -74,6 +74,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": 1660727616,
"narHash": "sha256-zYTIvdPMYMx/EYqXODAwIIU30RiEHqNHdgarIHuEYZc=",
"owner": "nix-community",
"repo": "nixos-generators",
"rev": "adccd191a0e83039d537e021f19495b7bad546a1",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixos-generators",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1663357389, "lastModified": 1663357389,
@ -124,6 +160,7 @@
"inputs": { "inputs": {
"darwin": "darwin", "darwin": "darwin",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixos-generators": "nixos-generators",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nur": "nur", "nur": "nur",
"wallpapers": "wallpapers", "wallpapers": "wallpapers",

View File

@ -32,9 +32,15 @@
flake = false; flake = false;
}; };
# Used to generate NixOS images for other platforms
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = { self, nixpkgs, darwin, wsl, home-manager, nur, wallpapers }: };
outputs = { self, nixpkgs, ... }@inputs:
let let
@ -57,14 +63,14 @@
in { in {
nixosConfigurations = { nixosConfigurations = with inputs; {
desktop = import ./hosts/desktop { desktop = import ./hosts/desktop {
inherit nixpkgs home-manager nur globals wallpapers; inherit nixpkgs home-manager nur globals wallpapers;
}; };
wsl = import ./hosts/wsl { inherit nixpkgs wsl home-manager globals; }; wsl = import ./hosts/wsl { inherit nixpkgs wsl home-manager globals; };
}; };
darwinConfigurations = { darwinConfigurations = with inputs; {
macbook = import ./hosts/macbook { macbook = import ./hosts/macbook {
inherit nixpkgs darwin home-manager nur globals; inherit nixpkgs darwin home-manager nur globals;
}; };
@ -110,6 +116,14 @@
}); });
# Package servers into images with a generator
packages.x86_64-linux = with inputs; {
aws = import ./generators/aws.nix {
inherit nixpkgs nixos-generators home-manager globals;
system = "x86_64-linux";
};
};
# Templates for starting other projects quickly # Templates for starting other projects quickly
templates = rec { templates = rec {
default = basic; default = basic;

19
generators/aws.nix Normal file
View File

@ -0,0 +1,19 @@
{ nixpkgs, system, nixos-generators, home-manager, globals, ... }:
nixos-generators.nixoGenerate {
inherit system;
imports = [
globals
home-manager.nixosModules.home-manager
{
networking.hostName = "sheep";
gui.enable = false;
colorscheme = (import ../../modules/colorscheme/gruvbox);
passwordHash =
"$6$PZYiMGmJIIHAepTM$Wx5EqTQ5GApzXx58nvi8azh16pdxrN6Qrv1wunDlzveOgawitWzcIxuj76X9V868fsPi/NOIEO8yVXqwzS9UF.";
}
../hosts/common.nix
../modules/nixos
];
format = "aws";
}