Fix the flake!
continuous-integration/drone the build was successful Details

This commit is contained in:
Olivier 'reivilibre' 2022-04-05 21:40:45 +01:00
parent ca45371d40
commit bc2801d7f0
4 changed files with 47 additions and 14 deletions

View File

@ -50,9 +50,22 @@
"inputs": {
"naersk": "naersk",
"nixpkgs": "nixpkgs_2",
"src": "src",
"utils": "utils"
}
},
"src": {
"flake": false,
"locked": {
"narHash": "sha256-9DWcuVadnJPko8LjBbV7nnYhCBc2VGQKKfo5QYUJFk0=",
"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,7 +16,7 @@
# `nix build`
packages.quickpeep = naersk-lib.buildPackage {
pname = "quickpeep";
root = ./..;
root = src;
buildInputs = with pkgs; [
openssl
pkgconfig
@ -39,7 +41,7 @@
# NixOS Modules
nixosModules = {
quickpeepSearch = import ./modules/quickpeepSearch.nix;
quickpeepSearch = import ./modules/quickpeepSearch.nix self;
};
# `nix run`

View File

@ -1,7 +1,8 @@
{config, pkgs, lib, quickpeep, ...}:
flake: {config, pkgs, lib, ...}:
let
cfg = config.services.quickpeepSearch;
inherit (flake.packages.${pkgs.stdenv.hostPlatform.system}) quickpeep;
in
with lib;
@ -19,7 +20,7 @@ with lib;
user = mkOption {
default = "quickpeep";
type = with types; uniq string;
type = with types; uniq str;
description = ''
Name of the user.
'';
@ -27,7 +28,7 @@ with lib;
bindHost = mkOption {
default = "127.0.0.1";
type = with types; string;
type = with types; str;
description = ''
Host upon which to bind the web interface.
'';
@ -44,6 +45,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.quickpeepSearch = {
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
@ -51,11 +59,8 @@ with lib;
serviceConfig = {
Type = "simple";
User = "${cfg.user}";
ExecStart = ''${quickpeep.quickpeep}/bin/quickpeep ${cfg.bindHost}:${cfg.bindPort}'';
ExecStart = ''${quickpeep}/bin/quickpeep ${cfg.bindHost}:${builtins.toString cfg.bindPort}'';
};
};
# TODO Do we need to specify quickpeep here?
environment.systemPackages = [ quickpeep.quickpeep ];
};
}

View File

@ -102,11 +102,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1648383610,
"narHash": "sha256-egKvd+S5FEpjwK2aCoJ+NrBG2m+9Njl4I1OXrDTZHvE=",
"lastModified": 1649117019,
"narHash": "sha256-ID7nw/8MDgqj/cbJ0wy6AtQ9wp58hSnE6+weZwuHnso=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7a3f9d626c8a88141077ab99d8352469aa6feeb7",
"rev": "ccb90fb9e11459aeaf83cc28d5f8910816d90dd0",
"type": "github"
},
"original": {
@ -148,10 +148,11 @@
"inputs": {
"naersk": "naersk",
"nixpkgs": "nixpkgs_4",
"src": "src",
"utils": "utils"
},
"locked": {
"narHash": "sha256-sIsKWG16MmzhkFFyHBgRPeSnREpDY1ylPjCBKhogsjs=",
"narHash": "sha256-ottHXBWVE2yM6xPwbKQuBL39BZTa1hlMYR30QA7TmzY=",
"path": "..",
"type": "path"
},
@ -168,6 +169,18 @@
"quickpeep": "quickpeep"
}
},
"src": {
"flake": false,
"locked": {
"narHash": "sha256-9DWcuVadnJPko8LjBbV7nnYhCBc2VGQKKfo5QYUJFk0=",
"path": "..",
"type": "path"
},
"original": {
"path": "..",
"type": "path"
}
},
"utils": {
"locked": {
"lastModified": 1648297722,