add flake for nixos-remote

This commit is contained in:
Jörg Thalheim 2022-12-09 14:56:06 +01:00
parent 5ff6a4fe33
commit 35d51df963
3 changed files with 31 additions and 8 deletions

View File

@ -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": {

View File

@ -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 {

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
'';
}