From 4d396b7feda15ca276bf34e9a28a0e208e6dd8ea Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Sun, 13 Nov 2022 23:14:04 +0300 Subject: [PATCH] add new user --- .agenix_config.nix | Bin 2766 -> 2842 bytes machines/default.nix | 1 + machines/home/default.nix | 3 ++- machines/modules/nix.nix | 13 ++++++++++++- notes/users.md | 5 +++++ secrets/users-nas-passfile.age | Bin 0 -> 1687 bytes users/nas/default.nix | 29 ++++++++++++++++++++++++++++ users/nas/home.nix | 34 +++++++++++++++++++++++++++++++++ 8 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 notes/users.md create mode 100644 secrets/users-nas-passfile.age create mode 100644 users/nas/default.nix create mode 100644 users/nas/home.nix diff --git a/.agenix_config.nix b/.agenix_config.nix index 7b876a88eae955bbb5e03a2d9bbcb70009819aa4..8f102d5b9cd7c5b6cb32ea5fb19647b47ae23013 100644 GIT binary patch literal 2842 zcmV+#3+40xM@dveQdv+`002v0|A`){K}2`99^QtUKiwjFj9FGGhHwu=K*V#Vi<#W( zO@sdt*4hmLB~_GQb0&4sG$)dB=ue(Qj93m7HJ^jy-!$4sYe+rah|hvf3!Z(J0cyx06iG z9Y*ZmgK3r`!pRCJYPynVYOa~rV4j`ZddR8?ceBd+{2o)xHFZ_E*}c04?|pc z39mm<_XFDy1FB<6f2}Hq7~b<~i~3g-D#TZ3tfS17g-g7T_nXdo02y@orh#-&e?Cb! z&G;u%W(!zGX_>)7PgAy4$dUIft`D8x#j3O&c}+>GsMT5n21bP1oJ7@kP~WyjEtB32 z12}ksJ`VAk^51Y}61XdH#fv09Ojd4Q^Z|{6ex+*YQS68SapsogY7CoL8*cTZ-7IXq zj9y}g`xYj%KWnGra7Ana9Y(b9`@4U)qa7dXd0=?2&CX(TyRD{wNbkmv0q~%Elyw5V ztk+-Vi{oS{DJp$xMIMS!6Xf)vV_2Xv)bAjv%GGoK4lFzqXQC>KTZQZkvSyJ6kl9q+ zsPmRMr9oDh(eaG$qwe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7YHBp z%FJKtDF>cvSobXG8RS3G_)Bl7MYJ8?KT1vRn8E}Y)D)Q=>$=tc%vNFTGh_RZ+_vHq zcpci(_Z56r>-OM}0Gw2AAm5P$Kln$Gv;|tN5*!N)wUrw4w})T4yWaTuodv9x?6(Zo zdC@v!&UyZiu|m{DM4n1|v?7mwZHvjHhnN51a9ZJ+3sSkMeQH~Y=MJOYynD4(NjMm9 zjH%Lb8@0lHp4|s0Zx4C)nJz+Ebmqb13R$t5RNZZ2j21fbjbE_{x)Jk z%|jwTCG#gaE%e~mR!UxltQuSjUbFzM4Hn7J+P6eMu?R26o;{h5bKNE09aho~oK;wG2zTq6a-P-y|TKerjh8BwhZ>oq2?=8f_ob zNIlFz1(5g!wMt^3e*Le+UnYrmHBb>)P;^J;l74|XhEri0-4E66kYXIbpS1N5+k5*( zz>KD%UO=TPycus4QG-{?ynzBo7qfZMgx(-UZB+ZeDb%MNOJp*+Yb+Q_7q|m>nmR%A z&Y#~3_qWvGqv8RuZ& z-L#=iYSo#0j!fB`;Ku$4X05IIWKm6GdX}JnS#g-_i5C7MgtCLZZ$UsQkaRR#r9&}L zAv=cN|3RBom&=D&smk86AP=Wf?m)m`5BnGf~a$hC5K$x`?-T zR?RafJ0rjvjI*9l!n##wk-RNoZ79s&HVczWE1GQu#sA+gOwL1KLMyR;SvshZ=w-&u zTA{Nisu}$7bjT^<+Zz7lEC8{MoO#b~84lmlBn??YZAgD|NZ`#QE%6z?C~I>mTR38Z zb3p&!UFMh{hio+p+J;d7>I8R?ekq?@7Ts)=E(cM05$>DNC_wq}241V9)bkL72ZiQS zu^AU_S`NNRbDX-RU1A}&1JDkPZQP=27;S{hMn7b6D^E37S#zQRg;PM7TbZlb-)06b Uz6?Kiw>ScJ&i2`gXLrKFq5BM2*#H0l diff --git a/machines/default.nix b/machines/default.nix index fc67ab2..14886ff 100644 --- a/machines/default.nix +++ b/machines/default.nix @@ -9,6 +9,7 @@ in extraModules = [ ../users/jan + ../users/nas ]; extraHomeModule = { ... }: { diff --git a/machines/home/default.nix b/machines/home/default.nix index 5a0a827..e690b26 100644 --- a/machines/home/default.nix +++ b/machines/home/default.nix @@ -41,7 +41,8 @@ networkmanager.enable = true; }; - nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "cnijfilter2" ]; + local.nix.allowUnfreePackages = [ "cnijfilter2" ]; + services = { avahi = { enable = true; diff --git a/machines/modules/nix.nix b/machines/modules/nix.nix index bcb19fc..f239a3b 100644 --- a/machines/modules/nix.nix +++ b/machines/modules/nix.nix @@ -1,6 +1,9 @@ { lib, config, ... }: -let cfg = config.local.nix; in +let + inherit (builtins) elem; + cfg = config.local.nix; +in { options.local.nix = with lib; { enableMyRegistry = mkOption { @@ -8,9 +11,17 @@ let cfg = config.local.nix; in default = false; description = "Enable my custom nix registry"; }; + allowUnfreePackages = mkOption { + type = types.listOf types.string; + default = [ ]; + }; }; config = { + nixpkgs.config.allowUnfreePredicate = lib.mkIf + (cfg.allowUnfreePackages != [ ]) + (pkg: elem (lib.getName pkg) cfg.allowUnfreePackages); + nix = { settings = { auto-optimise-store = true; diff --git a/notes/users.md b/notes/users.md new file mode 100644 index 0000000..cc56988 --- /dev/null +++ b/notes/users.md @@ -0,0 +1,5 @@ +# How create a password + +```sh +mkpasswd -m sha-512 +``` diff --git a/secrets/users-nas-passfile.age b/secrets/users-nas-passfile.age new file mode 100644 index 0000000000000000000000000000000000000000..50a9dfb4432ce07c08fdfad858a435864e51f19c GIT binary patch literal 1687 zcmV;I259*JM@dveQdv+`06Wg;^(mW$YXDR7Q9(Vg5P=(aowrhkV2B!U)@))@(A5oQ z0av91cd1;(EDIfa1UR1KpRztrry7DqWmyHKsw0&_7^1xA$@p_jz8DYP@A%K4zc;Yy zwUZK9FgvdVzZCibl`2d~LgV0nq;yA&47JdiwXm9aVns^yi68tb%{=w z-^EeGVQ!&5KPNY*d$m@i0sk;*QkZNBifPv%-A1f>g1rf4OD16Hn8acSP4q;VH9E7F zq5Ji}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