From 4e7aa1e0f004bfcf72937588d1069b54e08a7375 Mon Sep 17 00:00:00 2001 From: DashieTM Date: Sat, 10 May 2025 13:57:09 +0200 Subject: [PATCH 1/3] conf: default username to DashNix --- modules/conf.nix | 398 +++++++++++++++++++++++------------------------ 1 file changed, 199 insertions(+), 199 deletions(-) diff --git a/modules/conf.nix b/modules/conf.nix index d7a8dc2..93ec67e 100644 --- a/modules/conf.nix +++ b/modules/conf.nix @@ -1,199 +1,199 @@ -{ - lib, - config, - options, - ... -}: { - options.conf = { - system = lib.mkOption { - default = "x86_64-linux"; - # no fisherprice unix support - type = with lib.types; (enum [ - "x86_64-linux" - "aarch64-linux" - "aarch64-linux-android" - ]); - example = "aarch64-linux"; - description = '' - System architecture. - ''; - }; - - systemLocalTime = lib.mkOption { - default = false; - example = true; - description = '' - System time for dualbooting - ''; - }; - - wsl = lib.mkOption { - default = false; - example = true; - description = '' - Runs Nix in wsl - ''; - }; - - secureBoot = lib.mkOption { - default = false; - example = true; - description = '' - enables secure boot. - Note: Secure boot is NOT reproducible - Here are the necessary steps: - + create your keys with sbctl -> sudo sbctl create-keys - + build with systemd once -> set this to false and build once - + build with secureBoot true - + verify that your keys are signed (note, only systemd and your generations should now be signed): sudo sbtcl verify - + enroll your keys (microsoft is necessary for windows dualboot support, leave it there): sudo sbctl enroll-keys --microsoft - + reboot with secureboot enabled - Note: Some motherboards have vendor specific keys for secure boot, this may not necessarily work with our self signed keys - You likely have to disable these vendor specific keys (example HP: sure boot) - ''; - }; - - useSystemdBootloader = lib.mkOption { - default = true; - example = false; - description = '' - use systemd bootloader. - ''; - }; - - cpu = lib.mkOption { - # TODO: how to enable arm? - default = "amd"; - type = with lib.types; (enum [ - "amd" - "intel" - ]); - example = "intel"; - description = '' - cpu microcode. - ''; - }; - - additionalBootKernalParams = lib.mkOption { - default = [ - "video=${config.conf.defaultMonitor}:${config.conf.defaultMonitorMode}" - ]; - example = []; - type = with lib.types; listOf str; - description = '' - additional kernelParams passed to bootloader - ''; - }; - - defaultMonitor = lib.mkOption { - default = ""; - example = "eDP-1"; - type = lib.types.str; - description = '' - main monitor - ''; - }; - - defaultMonitorMode = lib.mkOption { - default = ""; - example = "3440x1440@180"; - type = lib.types.str; - description = '' - main monitor mode: width x height @ refreshrate - ''; - }; - - defaultMonitorScale = lib.mkOption { - default = "1"; - example = "1.5"; - type = lib.types.str; - description = '' - main monitor scaling - ''; - }; - - bootParams = lib.mkOption { - default = []; - example = ["resume=something"]; - type = with lib.types; listOf str; - description = '' - Boot params - ''; - }; - - kernelOverride = lib.mkOption { - default = null; - type = with lib.types; nullOr package; - description = '' - kernel to be used - Has no examples as doc complains... - #example = pkgs.linuxPackages_xanmod_latest; - ''; - }; - - username = lib.mkOption { - default = "dashie"; - example = "pingpang"; - type = lib.types.str; - description = '' - The username. - ''; - }; - - timezone = lib.mkOption { - default = "Europe/Zurich"; - example = "Europe/Berlin"; - type = lib.types.str; - description = '' - The timezone. - ''; - }; - - locale = lib.mkOption { - default = "en_US.UTF-8"; - example = "de_DE.UTF-8"; - type = lib.types.str; - description = '' - The locale. - ''; - }; - - nixosConfigPath = lib.mkOption { - default = "/home/${config.conf.username}/gits/nixos/."; - example = "yourpath/."; - type = lib.types.str; - description = '' - The path for your build command, you can then simply type rebuild to switch to a new configuration. - ''; - }; - - systemStateVersion = lib.mkOption { - example = "24.11"; - default = "23.05"; - type = lib.types.str; - description = '' - System state version - ''; - }; - homeStateVersion = lib.mkOption { - default = "24.11"; - example = "23.05"; - type = lib.types.str; - description = '' - Home state version - ''; - }; - }; - - config = - (lib.optionalAttrs (options ? system.stateVersion) { - boot = { - kernelPackages = lib.mkIf (config.conf.kernelOverride != null) config.conf.kernel; - kernelParams = config.conf.additionalBootKernalParams; - }; - system.stateVersion = config.conf.systemStateVersion; - }) - // (lib.optionalAttrs (options ? home.stateVersion) { - home.stateVersion = config.conf.homeStateVersion; - }); -} +{ + lib, + config, + options, + ... +}: { + options.conf = { + system = lib.mkOption { + default = "x86_64-linux"; + # no fisherprice unix support + type = with lib.types; (enum [ + "x86_64-linux" + "aarch64-linux" + "aarch64-linux-android" + ]); + example = "aarch64-linux"; + description = '' + System architecture. + ''; + }; + + systemLocalTime = lib.mkOption { + default = false; + example = true; + description = '' + System time for dualbooting + ''; + }; + + wsl = lib.mkOption { + default = false; + example = true; + description = '' + Runs Nix in wsl + ''; + }; + + secureBoot = lib.mkOption { + default = false; + example = true; + description = '' + enables secure boot. + Note: Secure boot is NOT reproducible + Here are the necessary steps: + + create your keys with sbctl -> sudo sbctl create-keys + + build with systemd once -> set this to false and build once + + build with secureBoot true + + verify that your keys are signed (note, only systemd and your generations should now be signed): sudo sbtcl verify + + enroll your keys (microsoft is necessary for windows dualboot support, leave it there): sudo sbctl enroll-keys --microsoft + + reboot with secureboot enabled + Note: Some motherboards have vendor specific keys for secure boot, this may not necessarily work with our self signed keys + You likely have to disable these vendor specific keys (example HP: sure boot) + ''; + }; + + useSystemdBootloader = lib.mkOption { + default = true; + example = false; + description = '' + use systemd bootloader. + ''; + }; + + cpu = lib.mkOption { + # TODO: how to enable arm? + default = "amd"; + type = with lib.types; (enum [ + "amd" + "intel" + ]); + example = "intel"; + description = '' + cpu microcode. + ''; + }; + + additionalBootKernalParams = lib.mkOption { + default = [ + "video=${config.conf.defaultMonitor}:${config.conf.defaultMonitorMode}" + ]; + example = []; + type = with lib.types; listOf str; + description = '' + additional kernelParams passed to bootloader + ''; + }; + + defaultMonitor = lib.mkOption { + default = ""; + example = "eDP-1"; + type = lib.types.str; + description = '' + main monitor + ''; + }; + + defaultMonitorMode = lib.mkOption { + default = ""; + example = "3440x1440@180"; + type = lib.types.str; + description = '' + main monitor mode: width x height @ refreshrate + ''; + }; + + defaultMonitorScale = lib.mkOption { + default = "1"; + example = "1.5"; + type = lib.types.str; + description = '' + main monitor scaling + ''; + }; + + bootParams = lib.mkOption { + default = []; + example = ["resume=something"]; + type = with lib.types; listOf str; + description = '' + Boot params + ''; + }; + + kernelOverride = lib.mkOption { + default = null; + type = with lib.types; nullOr package; + description = '' + kernel to be used + Has no examples as doc complains... + #example = pkgs.linuxPackages_xanmod_latest; + ''; + }; + + username = lib.mkOption { + default = "DashNix"; + example = "pingpang"; + type = lib.types.str; + description = '' + The username. + ''; + }; + + timezone = lib.mkOption { + default = "Europe/Zurich"; + example = "Europe/Berlin"; + type = lib.types.str; + description = '' + The timezone. + ''; + }; + + locale = lib.mkOption { + default = "en_US.UTF-8"; + example = "de_DE.UTF-8"; + type = lib.types.str; + description = '' + The locale. + ''; + }; + + nixosConfigPath = lib.mkOption { + default = "/home/${config.conf.username}/gits/nixos/."; + example = "yourpath/."; + type = lib.types.str; + description = '' + The path for your build command, you can then simply type rebuild to switch to a new configuration. + ''; + }; + + systemStateVersion = lib.mkOption { + example = "24.11"; + default = "23.05"; + type = lib.types.str; + description = '' + System state version + ''; + }; + homeStateVersion = lib.mkOption { + default = "24.11"; + example = "23.05"; + type = lib.types.str; + description = '' + Home state version + ''; + }; + }; + + config = + (lib.optionalAttrs (options ? system.stateVersion) { + boot = { + kernelPackages = lib.mkIf (config.conf.kernelOverride != null) config.conf.kernel; + kernelParams = config.conf.additionalBootKernalParams; + }; + system.stateVersion = config.conf.systemStateVersion; + }) + // (lib.optionalAttrs (options ? home.stateVersion) { + home.stateVersion = config.conf.homeStateVersion; + }); +} -- 2.51.2 From 11a41563c879caf8f43e4773ef9bdf2ed263b3c2 Mon Sep 17 00:00:00 2001 From: DashieTM Date: Sat, 10 May 2025 13:59:37 +0200 Subject: [PATCH 2/3] general: Remove all default dashie references --- base/xkb_layout.nix | 46 ++++++++++++++++++++-------------------- modules/programs/git.nix | 16 ++------------ modules/programs/xkb.nix | 2 +- 3 files changed, 26 insertions(+), 38 deletions(-) diff --git a/base/xkb_layout.nix b/base/xkb_layout.nix index db4fa60..ce87b6e 100644 --- a/base/xkb_layout.nix +++ b/base/xkb_layout.nix @@ -1,23 +1,23 @@ -{ - mkDashDefault, - pkgs, - ... -}: let - layout = pkgs.writeText "dashie" '' - xkb_symbols "dashie" - { - include "us(basic)" - include "level3(ralt_switch)" - key { [ a, A, adiaeresis, Adiaeresis ] }; - key { [ o, O, odiaeresis, Odiaeresis ] }; - key { [ u, U, udiaeresis, Udiaeresis ] }; - }; - ''; -in { - environment.systemPackages = mkDashDefault [pkgs.xorg.xkbcomp]; - services.xserver.xkb.extraLayouts.dashie = { - description = "US layout with 'umlaut'"; - languages = ["eng"]; - symbolsFile = "${layout}"; - }; -} +{ + mkDashDefault, + pkgs, + ... +}: let + layout = pkgs.writeText "enIntUmlaut" '' + xkb_symbols "enIntUmlaut" + { + include "us(basic)" + include "level3(ralt_switch)" + key { [ a, A, adiaeresis, Adiaeresis ] }; + key { [ o, O, odiaeresis, Odiaeresis ] }; + key { [ u, U, udiaeresis, Udiaeresis ] }; + }; + ''; +in { + environment.systemPackages = mkDashDefault [pkgs.xorg.xkbcomp]; + services.xserver.xkb.extraLayouts.enIntUmlaut = { + description = "US layout with 'umlaut'"; + languages = ["eng"]; + symbolsFile = "${layout}"; + }; +} diff --git a/modules/programs/git.nix b/modules/programs/git.nix index 9189329..ed2719e 100644 --- a/modules/programs/git.nix +++ b/modules/programs/git.nix @@ -34,27 +34,15 @@ description = "Additional git config"; }; sshConfig = lib.mkOption { - default = '' + default = ""; + example = '' Host github.com ${ if (config ? sops.secrets && config.sops.secrets ? hub.path) then "IdentityFile ${config.sops.secrets.hub.path}" else "" } - Host gitlab.com - ${ - if (config ? sops.secrets && config.sops.secrets ? lab.path) - then "IdentityFile ${config.sops.secrets.lab.path}" - else "" - } - Host dashie.org - ${ - if (config ? sops.secrets && config.sops.secrets ? dashie.path) - then "IdentityFile ${config.sops.secrets.dashie.path}" - else "" - } ''; - example = ""; type = lib.types.lines; description = "ssh configuration (keys for git)"; }; diff --git a/modules/programs/xkb.nix b/modules/programs/xkb.nix index 7ae8414..f78e5e2 100644 --- a/modules/programs/xkb.nix +++ b/modules/programs/xkb.nix @@ -6,7 +6,7 @@ }: { options.mods.xkb = { layout = lib.mkOption { - default = "dashie"; + default = "enIntUmlaut"; example = "us"; type = lib.types.str; description = "Your layout"; -- 2.51.2 From 67190c15467f9449d8aeb3a4c47584994e394a9e Mon Sep 17 00:00:00 2001 From: DashieTM Date: Sat, 10 May 2025 14:02:24 +0200 Subject: [PATCH 3/3] onedrive: init --- modules/programs/default.nix | 1 + modules/programs/onedrive.nix | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 modules/programs/onedrive.nix diff --git a/modules/programs/default.nix b/modules/programs/default.nix index b1d5103..fdfb163 100644 --- a/modules/programs/default.nix +++ b/modules/programs/default.nix @@ -28,6 +28,7 @@ ./mime.nix ./ncspot.nix ./nextcloud.nix + ./onedrive.nix ./oxi ./piper.nix ./plymouth.nix diff --git a/modules/programs/onedrive.nix b/modules/programs/onedrive.nix new file mode 100644 index 0000000..bcc3bc7 --- /dev/null +++ b/modules/programs/onedrive.nix @@ -0,0 +1,23 @@ +{ + lib, + config, + options, + ... +}: { + options.mods = { + onedrive = { + enable = lib.mkOption { + default = false; + example = true; + type = lib.types.bool; + description = "Enable onedrive program and service"; + }; + }; + }; + config = lib.mkIf config.mods.onedrive.enable ( + lib.optionalAttrs (options ? environment) { + services.onedrive.enable = true; + programs.onedrive.enable = true; + } + ); +} -- 2.51.2