create bootable nixos system
This commit is contained in:
34
flake.nix
34
flake.nix
@@ -3,9 +3,13 @@
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/nixos-unstable";
|
||||
nixos-generators = {
|
||||
url = "github:nix-community/nixos-generators";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
outputs = { self, nixpkgs, nixos-generators, ... }:
|
||||
let
|
||||
lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101";
|
||||
version = builtins.substring 0 8 lastModifiedDate;
|
||||
@@ -25,6 +29,34 @@
|
||||
src = ./client;
|
||||
vendorHash = null;
|
||||
};
|
||||
boot-env-iso = nixos-generators.nixosGenerate {
|
||||
inherit system;
|
||||
format = "iso";
|
||||
modules = [
|
||||
({modulesPath, ...}: {
|
||||
imports = [
|
||||
(modulesPath + "/profiles/minimal.nix")
|
||||
(modulesPath + "/profiles/base.nix")
|
||||
];
|
||||
|
||||
# Disable unneeded features
|
||||
## boot.loader.grub.enable = true;
|
||||
## boot.loader.grub.device = "nodev";
|
||||
documentation.enable = false;
|
||||
fonts.fontconfig.enable = false;
|
||||
services.udisks2.enable = false;
|
||||
|
||||
services.getty.autologinUser = "root";
|
||||
|
||||
environment.etc."profile.local".text = ''
|
||||
# Minimal shell prompt
|
||||
echo "It works!"
|
||||
'';
|
||||
|
||||
isoImage.squashfsCompression = "gzip -Xcompression-level 1";
|
||||
})
|
||||
];
|
||||
};
|
||||
});
|
||||
|
||||
devShells = forAllSystems (system:
|
||||
|
||||
Reference in New Issue
Block a user