extract personal options into global configs

- replacing hard-coded defaults across all of my modules
- personal = "my" username, ssh keys, …
secrix-issue25
Felix Stupp 2 months ago
parent 713019c2d9
commit 0362280029
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -37,6 +37,7 @@
let
nixosSystem = { modules, system }: inputs.nixpkgs.lib.nixosSystem {
modules = [
outputs.nixosModules.myOptions
outputs.nixosModules.withDepends
] ++ modules;
inherit system;
@ -113,6 +114,10 @@
# however, use on your own discretion
banananetwork = import ./nix/nixos-modules;
# this one defines common options for my systems to my modules
# you definitely do not want to use this
myOptions = import ./nix/myOptions.nix;
# this one also includes required dependencies from flake inputs
withDepends = {
imports = [

@ -0,0 +1,47 @@
# configures options only really useable for me
{ config
, lib
, pkgs
, ...
}:
let
myOpts = config.x-banananetwork;
in
{
config = {
x-banananetwork = {
# options defined in nixos-modules/options.nix
sshPublicKeys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAEAQDPRH3HSoCpoeqsovMuHOMvFxRFnCTxRIM2mUlAHo+Ef72F7103OeqwgL59rEFOWD8XS3sJhJ/k/dkLvvrANMDWiu5ofaJgA/SAwZzeC4Nh+1r+NWvuwlqvMWvka6Jg0U7l8ZLXD6s9Mmc7+kt4HYnF7xMcuaYBXyCj43eSG+EaiPDMW1Td3MdpzSYI6TvZN+iuhzpWNEemxAouyJvuKFggJM2XhrMHaPufabMIxVjekmMXce4uTeJ6ySaeXrIKEYofkvTC/3dqHQRlTvDGX0Jiy2T2CxX+24EdWlFdxWYBN0mPhimvwfdIynOUsvqn/1JTtj5JnYVG0MCygTUi9xJ2/0Djx+ecbbUXSROtUN+V4MHVUrg/43nkTBPVW5mRHQPpb42MeHw2AXbLJEXASdRivaJ9bpIffvGD11jiMrIKDS0Hh7nek0Y0qoGuT/04O/fZSbJiyRQqrk6FZNWzwO4xfUhD8oKjGeAypjJlOty3Krc4ivE1IzE1I4ELKRTZYt2pJln1nHCd/9ELik54JYm+viitAa/yhU4Rg+Qhhtzq5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AON+QFDHbkyN+pvj2b2pZ/3FcBb+fvVqZAlM0qEFiRoz7+fYYvZBqFL6OeYvIlas9FcJzycxX9TbVPsfjBlKya0v3MA+LcEOGPTwUnva9og8WQZAuPB0OKkMA46wyw+XwWJvOlIplt6OnYrT8nZ7J+gJGDDGMzCx8jckojoNBPiir0DJFaOhiPsJeW/3LW6yQib8OfgQ6R6RqUmEEKgjcM1tdnZxsrYGtF2q63ZcL4DB24nvGcLAw77Gyi9F0FU4H1uf096NIPM5Rmgvw48ZNkg4+kJ2PsVFO5H+wAmV23/dmIBz12Qltx+l5N9rSwyrIVplVulpd3B2lLm+Av6Jhn65qc5uEBH/0FyBz+HoXI9OBhFRRV+q5LqfTXrjWC8LhljjKHzWo4pPsQJp5TKOsoSLconeQG+ByP/iy1wfmXh+MLTK191Dw4Th2hZUHEMlek7y9SIKm/RY2buPxuQ== 93e1bd26f6b02fb@keys.banananet.work"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ322iTs4HagYWO5C/O8t2smxBOJNW68amar99H7f0kq zocker@zockerpc 2018-07-22"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOBdtHoYx74Dp2P/Th72JpY/vnSL8LUDG10HGoU+I162 zocker@thinkie 2019-06-04"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAEaWqcgeNh3BjyDXCg0DQfbuPg5VLVYlt8ucYu7VZNr zocker@x13yz 2024-07-04"
];
userName = "zocker";
# defaults for other modules, derived from them above
frontend = {
username = myOpts.userName;
};
};
};
}

@ -11,6 +11,7 @@
./debugMinimal.nix
./graphics.nix
./hwCommon.nix
./options.nix
./privacy.nix
./sshSecurity.nix
./useable.nix

@ -20,7 +20,6 @@ in
username = lib.mkOption {
description = "username of ego-centric single main primary user";
type = lib.types.str;
default = "zocker";
example = "username";
};
@ -361,13 +360,7 @@ in
"wheel"
];
isNormalUser = true;
openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAA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25519 AAAAC3NzaC1lZDI1NTE5AAAAIOBdtHoYx74Dp2P/Th72JpY/vnSL8LUDG10HGoU+I162 zocker@thinkie.khitomer.banananet.work 2019-06-04"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ322iTs4HagYWO5C/O8t2smxBOJNW68amar99H7f0kq zocker@zockerpc 2018-07-22"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAEaWqcgeNh3BjyDXCg0DQfbuPg5VLVYlt8ucYu7VZNr zocker@x13yz 2024-07-04"
];
openssh.authorizedKeys.keys = config.x-banananetwork.sshPublicKeys;
packages = with pkgs; lib.lists.flatten [
kdePackages.kate
(lib.lists.optional cfg.convertable [

@ -0,0 +1,38 @@
# options used across of my modules
# for me, most of them are defined in ../mySettings.nix
{ config
, lib
, pkgs
, ...
}:
{
options = {
x-banananetwork = {
sshPublicKeys = lib.mkOption {
description = ''
SSH public keys used to manage this system.
This is used by other option{x-banananetwork} modules.
'';
example = lib.literalExpression ''
[ "ssh-ed25519 ..." ]
'';
};
userName = lib.mkOption {
description = ''
my username for most/all uses
'';
example = lib.literalExpression "zocker";
};
};
};
}
Loading…
Cancel
Save