From 9868584ddabad45a9964ae9bf64d109963fd1e3d Mon Sep 17 00:00:00 2001 From: adikro Date: Thu, 12 Feb 2026 19:36:41 +0100 Subject: added install scripts --- flake.nix | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 11d2419..eaba51f 100644 --- a/flake.nix +++ b/flake.nix @@ -66,18 +66,19 @@ }; outputs = - { - self, - nixpkgs, - sops-nix, - ... - }@inputs: + { self, nixpkgs, ... }@inputs: let + system = "x86_64-linux"; + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + scripts = import ./scripts { inherit pkgs; }; mkHost = { hostname, - path, user ? "adam", + path ? ./hosts/${hostname}/configuration.nix, }: nixpkgs.lib.nixosSystem { specialArgs = { @@ -86,28 +87,30 @@ }; modules = [ path - sops-nix.nixosModules.sops { networking.hostName = hostname; } ]; }; in { + apps."x86_64-linux" = { + install = { + type = "app"; + program = "${scripts.install}/bin/nixos-install"; + }; + setup = { + type = "app"; + program = "${scripts.setup}/bin/nixos-setup"; + }; + }; nixosConfigurations = { szpont = mkHost { hostname = "szpont"; path = ./hosts/desktop/configuration.nix; }; - laptop = mkHost { - hostname = "laptop"; - path = ./hosts/laptop/configuration.nix; - }; - thinkpad = mkHost { - hostname = "thinkpad"; - path = ./hosts/thinkpad/configuration.nix; - }; + laptop = mkHost { hostname = "laptop"; }; + thinkpad = mkHost { hostname = "thinkpad"; }; pendrive = mkHost { hostname = "pendrive"; - path = ./hosts/pendrive/configuration.nix; user = "user"; }; }; -- cgit v1.3