diff --git a/flake.lock b/flake.lock index af264c7..afde9e2 100644 --- a/flake.lock +++ b/flake.lock @@ -23,16 +23,18 @@ }, "nixpkgs": { "locked": { - "lastModified": 1670525689, - "narHash": "sha256-YIjGzxrRQa5LYO0zlnH/ardcwXsRgsnHe3TkGkvCxbc=", - "owner": "NixOS", + "lastModified": 1670559856, + "narHash": "sha256-xUkgQRFqE6HIFQXs9SIXMZiXcLaH2415UR6w/FnsgcY=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "f21f11aa2a02cb78651c6d57546c7d7541f9240c", + "rev": "6bc6f77cb171a74001033d94f17f49043a9f1804", "type": "github" }, "original": { - "id": "nixpkgs", - "type": "indirect" + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" } }, "root": { diff --git a/flake.nix b/flake.nix index 1ff2d91..3536a6c 100644 --- a/flake.nix +++ b/flake.nix @@ -1,11 +1,24 @@ { description = "A universal nixos installer, just needs ssh access to the target system"; - inputs.nixpkgs.url = "nixpkgs"; + inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; inputs.disko.url = "github:nix-community/disko/master"; inputs.disko.inputs.nixpkgs.follows = "nixpkgs"; - outputs = { self, nixpkgs, disko, ... }: { + outputs = { self, disko, nixpkgs, ... }: let + supportedSystems = [ + "x86_64-linux" + "i686-linux" + "aarch64-linux" + ]; + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + in { + packages = forAllSystems (system: let + pkgs = nixpkgs.legacyPackages.${system}; + in { + nixos-remote = pkgs.callPackage ./package.nix {}; + default = self.packages.${system}.nixos-remote; + }); checks.x86_64-linux = let pkgs = nixpkgs.legacyPackages.x86_64-linux; in { diff --git a/package.nix b/package.nix new file mode 100644 index 0000000..efd036e --- /dev/null +++ b/package.nix @@ -0,0 +1,8 @@ +{ stdenvNoCC }: +stdenvNoCC.mkDerivation { + name = "nixos-remote"; + src = ./.; + installPhase = '' + install -D -m755 nixos-remote $out/bin/nixos-remote + ''; +}