Fix Flake

This commit is contained in:
Olivier 'reivilibre' 2022-04-05 15:24:28 +01:00
parent 398c675d9e
commit 7ff527be0d
4 changed files with 46 additions and 11 deletions

View File

@ -50,9 +50,22 @@
"inputs": {
"naersk": "naersk",
"nixpkgs": "nixpkgs_2",
"src": "src",
"utils": "utils"
}
},
"src": {
"flake": false,
"locked": {
"narHash": "sha256-8vp3LGoPRzhitzLCbTS7QnCz89bsVn48oS2aXIwAmjU=",
"path": "..",
"type": "path"
},
"original": {
"path": "..",
"type": "path"
}
},
"utils": {
"locked": {
"lastModified": 1648297722,

View File

@ -4,9 +4,11 @@
inputs = {
utils.url = "github:numtide/flake-utils";
naersk.url = "github:nix-community/naersk";
src.url = "path:..";
src.flake = false;
};
outputs = { self, nixpkgs, utils, naersk }:
outputs = { self, nixpkgs, utils, naersk, src }:
utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages."${system}";
naersk-lib = naersk.lib."${system}";
@ -14,14 +16,15 @@
# `nix build`
packages.hallo = naersk-lib.buildPackage {
pname = "hallo";
root = ./..;
#root = ./..;
root = src;
};
defaultPackage = packages.hallo;
# NixOS Modules
nixosModules = {
halloSvc = import ./modules/halloSvc.nix;
halloSvc = import ./modules/halloSvc.nix self;
};
# `nix run`

View File

@ -1,7 +1,8 @@
{config, pkgs, lib, hallo, ...}:
flake: {config, pkgs, lib, hallo, ...}:
let
cfg = config.services.halloSvc;
inherit (flake.packages.${pkgs.stdenv.hostPlatform.system}) hallo;
in
with lib;
@ -28,6 +29,13 @@ with lib;
};
config = mkIf cfg.enable {
users.users."${cfg.user}" = {
description = "Hallo daemon user";
isSystemUser = true;
group = "${cfg.user}";
};
users.groups."${cfg.user}" = {};
systemd.services.halloSvc = {
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
@ -35,10 +43,8 @@ with lib;
serviceConfig = {
Type = "simple";
User = "${cfg.user}";
ExecStart = ''${hallo.hallo}/bin/hallo'';
ExecStart = ''${hallo}/bin/hallo'';
};
};
environment.systemPackages = [ hallo.hello ];
};
}

View File

@ -19,10 +19,11 @@
"inputs": {
"naersk": "naersk",
"nixpkgs": "nixpkgs_2",
"src": "src",
"utils": "utils"
},
"locked": {
"narHash": "sha256-LyX46m+YB08861YXrWWmdUTT9uQtyjE96/1beyeETbM=",
"narHash": "sha256-4TE+4kf1Q4LqorKsKRrspJYm8iHGX6XtMQLXG5+IN7k=",
"path": "..",
"type": "path"
},
@ -146,11 +147,11 @@
},
"nixpkgs_4": {
"locked": {
"lastModified": 1649024309,
"narHash": "sha256-AWbvj/NHZXVwAnHaVOFlxg7tcNerEKrKBmgGfztSHWM=",
"lastModified": 1649117019,
"narHash": "sha256-ID7nw/8MDgqj/cbJ0wy6AtQ9wp58hSnE6+weZwuHnso=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "af0a9bc0e5341855518e9c1734d7ef913e5138b9",
"rev": "ccb90fb9e11459aeaf83cc28d5f8910816d90dd0",
"type": "github"
},
"original": {
@ -168,6 +169,18 @@
"nixpkgs": "nixpkgs_4"
}
},
"src": {
"flake": false,
"locked": {
"narHash": "sha256-8vp3LGoPRzhitzLCbTS7QnCz89bsVn48oS2aXIwAmjU=",
"path": "..",
"type": "path"
},
"original": {
"path": "..",
"type": "path"
}
},
"utils": {
"locked": {
"lastModified": 1648297722,