From 1c797819361e141e1345e2f626d6d6ee52991adc Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Wed, 1 Jan 2020 19:12:59 -0700 Subject: [PATCH] niximg: init iso configuration Easily build the iso using `nix build $ISO` thanks to direnv. --- .envrc | 1 + hosts/NixOS.nix | 6 ++++++ hosts/default.nix | 4 ++++ hosts/niximg.nix | 8 ++++++++ 4 files changed, 19 insertions(+) create mode 100644 .envrc create mode 100644 hosts/NixOS.nix create mode 100644 hosts/niximg.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..aad51ee --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +export ISO=".#nixosConfigurations.niximg.config.system.build.isoImage" diff --git a/hosts/NixOS.nix b/hosts/NixOS.nix new file mode 100644 index 0000000..d435b3b --- /dev/null +++ b/hosts/NixOS.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ../profiles/develop + ../profiles/misc + ]; +} diff --git a/hosts/default.nix b/hosts/default.nix index b10d4ca..d67a8b8 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -30,12 +30,16 @@ let }; local = import "${toString ./.}/${self}.nix"; + + iso = nixpkgs.lib.optionalAttrs (self == "niximg") + (import "${nixpkgs}/nixos/modules/installer/cd-dvd/iso-image.nix"); in attrValues flake.nixosModules ++ [ core global local home + iso ]; }; diff --git a/hosts/niximg.nix b/hosts/niximg.nix new file mode 100644 index 0000000..09e5f64 --- /dev/null +++ b/hosts/niximg.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ./NixOS.nix + ]; + + isoImage.makeEfiBootable = true; + isoImage.makeUsbBootable = true; +}