diff --git a/flake.nix b/flake.nix index 3d6a79f..9cd99ef 100644 --- a/flake.nix +++ b/flake.nix @@ -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 = [ diff --git a/nix/myOptions.nix b/nix/myOptions.nix new file mode 100644 index 0000000..7d33c47 --- /dev/null +++ b/nix/myOptions.nix @@ -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/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FihFtSF4u12b1Bze5tAON+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; + }; + + + }; + + + }; + + +} diff --git a/nix/nixos-modules/default.nix b/nix/nixos-modules/default.nix index b2a106b..9736f53 100644 --- a/nix/nixos-modules/default.nix +++ b/nix/nixos-modules/default.nix @@ -11,6 +11,7 @@ ./debugMinimal.nix ./graphics.nix ./hwCommon.nix + ./options.nix ./privacy.nix ./sshSecurity.nix ./useable.nix diff --git a/nix/nixos-modules/frontend/default.nix b/nix/nixos-modules/frontend/default.nix index 65cca6f..488d1c6 100644 --- a/nix/nixos-modules/frontend/default.nix +++ b/nix/nixos-modules/frontend/default.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 AAAAB3NzaC1yc2EAAAADAQABAAAEAQDPRH3HSoCpoeqsovMuHOMvFxRFnCTxRIM2mUlAHo+Ef72F7103OeqwgL59rEFOWD8XS3sJhJ/k/dkLvvrANMDWiu5ofaJgA/SAwZzeC4Nh+1r+NWvuwlqvMWvka6Jg0U7l8ZLXD6s9Mmc7+kt4HYnF7xMcuaYBXyCj43eSG+EaiPDMW1Td3MdpzSYI6TvZN+iuhzpWNEemxAouyJvuKFggJM2XhrMHaPufabMIxVjekmMXce4uTeJ6ySaeXrIKEYofkvTC/3dqHQRlTvDGX0Jiy2T2CxX+24EdWlFdxWYBN0mPhimvwfdIynOUsvqn/1JTtj5JnYVG0MCygTUi9xJ2/0Djx+ecbbUXSROtUN+V4MHVUrg/43nkTBPVW5mRHQPpb42MeHw2AXbLJEXASdRivaJ9bpIffvGD11jiMrIKDS0Hh7nek0Y0qoGuT/04O/fZSbJiyRQqrk6FZNWzwO4xfUhD8oKjGeAypjJlOty3Krc4ivE1IzE1I4ELKRTZYt2pJln1nHCd/9ELik54JYm+viitAa/yhU4Rg+Qhhtzq5rw6MonUfhLRgmvt2oq4JQWlqFz/qXEdtx3OOKMNZDbzlbFzDRAgP/Jqt7sx2QvivKI5kGpmlk9NXKaH/ucpTFbOkGFcx/bLOov6YfyrrRbwqHi7ZkUPT2BCo5KWvjr/cM5sRQc6Qs+aXD5Bye1Nd3SWMOj1izXd36RxCBqtfzXi5rkPE59qlB7gJ0Q1I49C1WyKUgd15Aw7CubHLpKZRXu8ko5xJ3JQhe15lIrLqMUUATb45DIrsVb3kueA5v8AMSi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PM5Rmgvw48ZNkg4+kJ2PsVFO5H+wAmV23/dmIBz12Qltx+l5N9rSwyrIVplVulpd3B2lLm+Av6Jhn65qc5uEBH/0FyBz+HoXI9OBhFRRV+q5LqfTXrjWC8LhljjKHzWo4pPsQJp5TKOsoSLconeQG+ByP/iy1wfmXh+MLTK191Dw4Th2hZUHEMlek7y9SIKm/RY2buPxuQ== 93e1bd26f6b02fb@keys.banananet.work" - "ssh-ed25519 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 [ diff --git a/nix/nixos-modules/options.nix b/nix/nixos-modules/options.nix new file mode 100644 index 0000000..d36d652 --- /dev/null +++ b/nix/nixos-modules/options.nix @@ -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"; + }; + + }; + + }; + +}