aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2020-12-31 00:13:07 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2020-12-31 11:32:20 +0100
commite8864bbff33f33b1de4929037a81368263c5475b (patch)
treec40133ede864146e0f7c8fb63caf75a528a480a2
parentbb9bc238b55d59a62dedb541b1584167a41a2996 (diff)
downloadNix-e8864bbff33f33b1de4929037a81368263c5475b.tar.gz
Nix-e8864bbff33f33b1de4929037a81368263c5475b.tar.zst
Nix-e8864bbff33f33b1de4929037a81368263c5475b.zip
Use flake for openarc
-rw-r--r--flakes/openarc/flake.nix12
-rw-r--r--lib/default.nix1
-rw-r--r--lib/flake-compat.nix6
-rw-r--r--modules/default.nix5
-rw-r--r--pkgs/default.nix2
5 files changed, 19 insertions, 7 deletions
diff --git a/flakes/openarc/flake.nix b/flakes/openarc/flake.nix
index 6110b2d..bdb0358 100644
--- a/flakes/openarc/flake.nix
+++ b/flakes/openarc/flake.nix
@@ -117,13 +117,15 @@
117 }; 117 };
118 118
119 config = lib.mkIf cfg.enable { 119 config = lib.mkIf cfg.enable {
120 users.users.openarc = lib.optionalAttrs (cfg.user == "openarc") { 120 users.users = lib.optionalAttrs (cfg.user == "openarc") {
121 group = cfg.group; 121 openarc = {
122 uid = myuids.lib.uids.openarc; 122 group = cfg.group;
123 uid = myuids.lib.uids.openarc;
124 };
123 }; 125 };
124 126
125 users.groups.openarc = lib.optionalAttrs (cfg.group == "openarc") { 127 users.groups = lib.optionalAttrs (cfg.group == "openarc") {
126 gid = myuids.lib.gids.openarc; 128 openarc.gid = myuids.lib.gids.openarc;
127 }; 129 };
128 130
129 environment.systemPackages = [ self.defaultPackage."${pkgs.system}" ]; 131 environment.systemPackages = [ self.defaultPackage."${pkgs.system}" ];
diff --git a/lib/default.nix b/lib/default.nix
index 57bde79..7b392f1 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -1,6 +1,7 @@
1{ pkgs }: 1{ pkgs }:
2with pkgs; 2with pkgs;
3rec { 3rec {
4 flakeCompat = import ./flake-compat.nix;
4 nodeEnv = import ./node-env.nix; 5 nodeEnv = import ./node-env.nix;
5 6
6 fetchedGithub = path: 7 fetchedGithub = path:
diff --git a/lib/flake-compat.nix b/lib/flake-compat.nix
new file mode 100644
index 0000000..1f0d492
--- /dev/null
+++ b/lib/flake-compat.nix
@@ -0,0 +1,6 @@
1src:
2(import (
3 fetchTarball {
4 url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
5 sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2";
6 }) { inherit src; }).defaultNix
diff --git a/modules/default.nix b/modules/default.nix
index 03b9adc..059a9d8 100644
--- a/modules/default.nix
+++ b/modules/default.nix
@@ -1,3 +1,6 @@
1let
2 flakeCompat = import ../lib/flake-compat.nix;
3in
1{ 4{
2 myids = ./myids.nix; 5 myids = ./myids.nix;
3 secrets = ./secrets.nix; 6 secrets = ./secrets.nix;
@@ -12,7 +15,7 @@
12 fiche = ./webapps/fiche.nix; 15 fiche = ./webapps/fiche.nix;
13 16
14 opendmarc = ./opendmarc.nix; 17 opendmarc = ./opendmarc.nix;
15 openarc = ./openarc.nix; 18 openarc = (flakeCompat ../flakes/openarc).nixosModule;
16 19
17 duplyBackup = ./duply_backup; 20 duplyBackup = ./duply_backup;
18 rsyncBackup = ./rsync_backup; 21 rsyncBackup = ./rsync_backup;
diff --git a/pkgs/default.nix b/pkgs/default.nix
index b260f97..ff21a20 100644
--- a/pkgs/default.nix
+++ b/pkgs/default.nix
@@ -22,7 +22,7 @@ rec {
22 notmuch-python2 = callPackage ./notmuch/notmuch-python { pythonPackages = python2Packages; }; 22 notmuch-python2 = callPackage ./notmuch/notmuch-python { pythonPackages = python2Packages; };
23 notmuch-python3 = callPackage ./notmuch/notmuch-python { pythonPackages = python3Packages; }; 23 notmuch-python3 = callPackage ./notmuch/notmuch-python { pythonPackages = python3Packages; };
24 notmuch-vim = callPackage ./notmuch/notmuch-vim {}; 24 notmuch-vim = callPackage ./notmuch/notmuch-vim {};
25 openarc = callPackage ./openarc { inherit mylibs; }; 25 openarc = (mylibs.flakeCompat ../flakes/openarc).default;
26 opendmarc = callPackage ./opendmarc { libspf2 = callPackage ./opendmarc/libspf2.nix {}; }; 26 opendmarc = callPackage ./opendmarc { libspf2 = callPackage ./opendmarc/libspf2.nix {}; };
27 pg_activity = callPackage ./pg_activity { inherit mylibs; }; 27 pg_activity = callPackage ./pg_activity { inherit mylibs; };
28 pgloader = callPackage ./pgloader {}; 28 pgloader = callPackage ./pgloader {};