add flake for nixos-remote

This commit is contained in:
Jörg Thalheim 2022-12-09 14:56:06 +01:00
parent f4235fead3
commit 26258d1b24
3 changed files with 56 additions and 0 deletions

27
flake.lock Normal file
View File

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1670559856,
"narHash": "sha256-xUkgQRFqE6HIFQXs9SIXMZiXcLaH2415UR6w/FnsgcY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "6bc6f77cb171a74001033d94f17f49043a9f1804",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

21
flake.nix Normal file
View File

@ -0,0 +1,21 @@
{
description = "Install nixos everywhere via ssh";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
outputs = { self, 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;
});
};
}

8
package.nix Normal file
View File

@ -0,0 +1,8 @@
{ stdenvNoCC }:
stdenvNoCC.mkDerivation {
name = "nixos-remote";
src = ./.;
installPhase = ''
install -D -m755 nixos-remote $out/bin/nixos-remote
'';
}