hah, fixed manwe only to break orome

This commit is contained in:
Chris Kruining 2025-03-18 21:57:16 +01:00
parent af58cfb4ab
commit 1172e2bd68
15 changed files with 133 additions and 105 deletions

View file

@ -12,64 +12,10 @@
}; };
modules = { modules = {
themes = {
enable = true;
theme = "everforest";
polarity = "dark";
};
system.audio.enable = true; system.audio.enable = true;
networking.enable = true; networking.enable = true;
develop = {
rust.enable = true;
js.enable = true;
dotnet.enable = true;
};
# EXPERIMENTS # EXPERIMENTS
# services.games.minecraft.enable = true;
services.auth.enable = true; services.auth.enable = true;
desktop = {
plasma.enable = true;
applications = {
communication.enable = true;
email.enable = true;
office.enable = true;
steam.enable = true;
recording.enable = true;
};
terminal = {
default = "ghostty";
alacritty.enable = true;
ghostty.enable = true;
};
editors = {
default = "zed";
vscodium.enable = true;
zed.enable = true;
nvim.enable = true;
nano.enable = true;
kate.enable = true;
};
browsers = {
default = "chromium";
firefox.enable = true;
chrome.enable = true;
};
games = {
minecraft.enable = true;
};
};
shell = {
default = "zsh";
};
}; };
} }

View file

@ -1,5 +1,58 @@
{}: { ... }:
{ {
full_name = "WOOOP WOOOP"; # full_name = "WOOOP WOOOP";
is_trusted = false; # is_trusted = false;
themes = {
enable = true;
theme = "everforest";
polarity = "dark";
};
develop = {
rust.enable = true;
js.enable = true;
dotnet.enable = true;
};
desktop = {
plasma.enable = true;
applications = {
communication.enable = true;
email.enable = true;
office.enable = true;
steam.enable = true;
recording.enable = true;
};
terminal = {
default = "ghostty";
alacritty.enable = true;
ghostty.enable = true;
};
editors = {
default = "zed";
vscodium.enable = true;
zed.enable = true;
nvim.enable = true;
nano.enable = true;
kate.enable = true;
};
browsers = {
default = "chromium";
firefox.enable = true;
chrome.enable = true;
};
games = {
minecraft.enable = true;
};
};
shell = {
default = "zsh";
};
} }

View file

@ -0,0 +1,4 @@
{ ... }:
{
kaas = true;
}

View file

@ -7,7 +7,7 @@ args@{
}: let }: let
inherit (inputs.nixpkgs.lib) nixosSystem; inherit (inputs.nixpkgs.lib) nixosSystem;
inherit (builtins) baseNameOf elem map; inherit (builtins) baseNameOf elem map;
inherit (lib.attrsets) filterAttrs; inherit (lib) filterAttrs attrValues attrNames;
inherit (lib.modules) mkAliasOptionModule mkDefault mkIf; inherit (lib.modules) mkAliasOptionModule mkDefault mkIf;
inherit (lib.strings) removeSuffix; inherit (lib.strings) removeSuffix;
inherit (self.modules) mapModules mapModulesRec'; inherit (self.modules) mapModules mapModulesRec';
@ -23,6 +23,8 @@ in rec
modules = modules =
let let
stateVersion = "23.11"; stateVersion = "23.11";
users = attrNames (mapModules "${path}/users" (p: p));
in [ in [
inputs.nixos-boot.nixosModules.default inputs.nixos-boot.nixosModules.default
{ {
@ -38,7 +40,7 @@ in rec
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
"${path}/hardware.nix" "${path}/hardware.nix"
] ]
++ (mapModulesRec' (toString ../modules/system) import); ++ (mapModulesRec' ../modules/system import);
users = { users = {
mutableUsers = true; # Set this to false when I get sops with passwords set up properly mutableUsers = true; # Set this to false when I get sops with passwords set up properly
@ -55,22 +57,20 @@ in rec
users = mapModules "${path}/users" (p: mkHmUser p stateVersion); users = mapModules "${path}/users" (p: mkHmUser p stateVersion);
}; };
} }
{
_module.args.user = "chris";
imports = []
++ (mapModulesRec' ../modules/home (file: file));
# ++ (mapModulesRec' ../modules/home (file: file));
# ++ (mapModulesRec' ../modules/home (file: import file (args // { user = "chris"; })))
# ++ (mapModulesRec' ../modules/home (file: import file (args // { user = "kaas"; })));
modules.chris = (import "${path}/users/chris/default.nix" args);
# modules.kaas = (import "${path}/users/kaas/default.nix" args);
}
(filterAttrs (n: v: !elem n ["system"]) attrs) (filterAttrs (n: v: !elem n ["system"]) attrs)
../. # ../default.nix ../. # ../default.nix
(import path) (import path)
]; ]
++ (map (user: {
_module.args.user = user;
imports = [
"${path}/users/${user}/test.nix"
]
++ (mapModulesRec' ../modules/home (file: file));
modules.${user} = (import "${path}/users/${user}/default.nix" args);
}) users);
}; };
mapHosts = dir: attrs @ {system ? system, ...}: mapHosts = dir: attrs @ {system ? system, ...}:

View file

@ -22,7 +22,7 @@ in rec
}; };
mkHmUser = path: stateVersion: let mkHmUser = path: stateVersion: let
user = import path {}; # user = import path {};
name = removeSuffix ".nix" (baseNameOf path); name = removeSuffix ".nix" (baseNameOf path);
in in
{ {

View file

@ -16,7 +16,7 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ user.packages = with pkgs; [
(ungoogled-chromium.override { (ungoogled-chromium.override {
commandLineArgs = [ commandLineArgs = [
"--enable-features=AcceleratedVideoEncoder" "--enable-features=AcceleratedVideoEncoder"
@ -28,7 +28,7 @@ in {
}) })
]; ];
home-manager.users.${user}.programs.chromium = { programs.chromium = {
enable = true; enable = true;
enablePlasmaBrowserIntegration = true; enablePlasmaBrowserIntegration = true;
extensions = [ extensions = [

View file

@ -6,6 +6,7 @@ let
inherit (lib.strings) concatStrings; inherit (lib.strings) concatStrings;
cfg = config.modules.${user}.desktop.browsers.firefox; cfg = config.modules.${user}.desktop.browsers.firefox;
usr = config.users.users.${user};
in { in {
options.modules.${user}.desktop.browsers.firefox = let options.modules.${user}.desktop.browsers.firefox = let
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
@ -15,7 +16,7 @@ in {
enable = mkEnableOption "Gecko-based libre browser"; enable = mkEnableOption "Gecko-based libre browser";
privacy.enable = mkEnableOption "Privacy Focused Firefox fork"; privacy.enable = mkEnableOption "Privacy Focused Firefox fork";
profileName = mkOpt str config.user.name; profileName = mkOpt str usr.name;
settings = mkOpt' (attrsOf (oneOf [bool int str])) {} '' settings = mkOpt' (attrsOf (oneOf [bool int str])) {} ''
Firefox preferences set in <filename>user.js</filename> Firefox preferences set in <filename>user.js</filename>
''; '';
@ -69,7 +70,7 @@ in {
# Enables userContent.css and userChrome.css for our theme modules # Enables userContent.css and userChrome.css for our theme modules
"toolkit.legacyUserProfileCustomizations.stylesheets" = true; "toolkit.legacyUserProfileCustomizations.stylesheets" = true;
# Stop creating ~/Downloads! # Stop creating ~/Downloads!
"browser.download.dir" = "${config.user.home}/downloads"; "browser.download.dir" = "${usr.home}/downloads";
# Disables built-in password manager -> use external PM! # Disables built-in password manager -> use external PM!
"signon.rememberSignons" = false; "signon.rememberSignons" = false;
# Firefox, DO NOT CHECK if you are the default browser.. # Firefox, DO NOT CHECK if you are the default browser..

View file

@ -11,7 +11,11 @@ in
in { enable = mkEnableOption "nano"; }; in { enable = mkEnableOption "nano"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home-manager.users.${user}.programs.nano = { user.packages = with pkgs; [
nano
];
programs.nano = {
enable = true; enable = true;
syntaxHighlight = true; syntaxHighlight = true;
nanorc = '' nanorc = ''

View file

@ -15,7 +15,7 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
modules.desktop.editors.nvim.enable = true; modules.desktop.editors.nvim.enable = true;
home-manager.users.${user}.programs.nvf = { programs.nvf = {
enable = true; enable = true;
settings = { settings = {
vim = { vim = {

View file

@ -1,13 +1,13 @@
{ config, options, lib, pkgs, user, ... }: { config, options, lib, pkgs, user, ... }:
let let
inherit (lib.meta) getExe; inherit (lib.meta) getExe;
inherit (lib.modules) mkOption mkIf; inherit (lib.modules) mkIf;
cfg = config.modules.${user}.desktop.plasma; cfg = config.modules.${user}.desktop.plasma;
in in
{ {
options.modules.${user}.desktop.plasma = let options.modules.${user}.desktop.plasma = let
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption mkOption;
in { in {
enable = mkEnableOption "plasma 6"; enable = mkEnableOption "plasma 6";
@ -42,9 +42,10 @@ in
]; ];
# should enable theme integration with gtk apps (i.e. firefox, thunderbird) # should enable theme integration with gtk apps (i.e. firefox, thunderbird)
home-manager.users.${user}.programs.dconf.enable = true; programs.dconf.enable = true;
home-manager.users.${user}.programs.plasma = { home-manager.users.${user}.programs = {
plasma = {
enable = true; enable = true;
kwin = { kwin = {
@ -57,4 +58,5 @@ in
}; };
}; };
}; };
};
} }

View file

@ -1,16 +1,16 @@
{ config, options, lib, pkgs, ... }: { config, options, lib, pkgs, user, ... }:
let let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
in in
{ {
options.modules.develop = let options.modules.${user}.develop = let
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
in in
{ {
xdg.enable = mkEnableOption "XDG-related conf" // { default = true; }; xdg.enable = mkEnableOption "XDG-related conf" // { default = true; };
}; };
config = mkIf config.modules.develop.xdg.enable { config = mkIf config.modules.${user}.develop.xdg.enable {
}; };
} }

View file

@ -1,16 +1,16 @@
{ inputs, config, options, lib, pkgs, ... }: { inputs, config, options, lib, pkgs, user, ... }:
let let
inherit (lib.attrsets) attrValues; inherit (lib.attrsets) attrValues;
inherit (lib.modules) mkIf mkMerge; inherit (lib.modules) mkIf mkMerge;
in in
{ {
options.modules.develop.dotnet = let options.modules.${user}.develop.dotnet = let
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
in { in {
enable = mkEnableOption ".NET developmnt"; enable = mkEnableOption ".NET developmnt";
}; };
config = mkIf config.modules.develop.dotnet.enable { config = mkIf config.modules.${user}.develop.dotnet.enable {
user.packages = attrValues { user.packages = attrValues {
inherit (pkgs) dotnet-sdk_8; inherit (pkgs) dotnet-sdk_8;
}; };

View file

@ -1,17 +1,17 @@
{ inputs, config, options, lib, pkgs, ... }: { inputs, config, options, lib, pkgs, user, ... }:
let let
inherit (lib.attrsets) attrValues; inherit (lib.attrsets) attrValues;
inherit (lib.modules) mkIf mkMerge; inherit (lib.modules) mkIf mkMerge;
in in
{ {
options.modules.develop.js = let options.modules.${user}.develop.js = let
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
in { in {
enable = mkEnableOption "JS developmnt"; enable = mkEnableOption "JS developmnt";
}; };
config = mkMerge [ config = mkMerge [
(mkIf config.modules.develop.js.enable { (mkIf config.modules.${user}.develop.js.enable {
user.packages = with pkgs; [ user.packages = with pkgs; [
bun bun
nodejs nodejs
@ -20,7 +20,7 @@ in
}) })
(mkIf config.modules.develop.xdg.enable { (mkIf config.modules.${user}.develop.xdg.enable {
# home = { # home = {
# }; # };
}) })

View file

@ -1,18 +1,18 @@
{ inputs, config, options, lib, pkgs, ... }: { inputs, config, options, lib, pkgs, user, ... }:
let let
inherit (lib.attrsets) attrValues; inherit (lib.attrsets) attrValues;
inherit (lib.modules) mkIf mkMerge; inherit (lib.modules) mkIf mkMerge;
inherit (lib.meta) getExe; inherit (lib.meta) getExe;
in in
{ {
options.modules.develop.rust = let options.modules.${user}.develop.rust = let
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
in { in {
enable = mkEnableOption "Rust developmnt"; enable = mkEnableOption "Rust developmnt";
}; };
config = mkMerge [ config = mkMerge [
# (mkIf config.modules.develop.rust.enable { # (mkIf config.modules.${user}.develop.rust.enable {
# # nixpkgs.overlays = [inputs.rust.overlays.default]; # # nixpkgs.overlays = [inputs.rust.overlays.default];
# #
# user.packages = attrValues { # user.packages = attrValues {
@ -26,7 +26,7 @@ in
# }; # };
# }) # })
# #
# (mkIf config.modules.develop.xdg.enable { # (mkIf config.module.${user}s.develop.xdg.enable {
# home = { # home = {
# sessionVariables.CARGO_HOME = "$XDG_DATA_HOME/cargo"; # sessionVariables.CARGO_HOME = "$XDG_DATA_HOME/cargo";
# sessionPath = ["$CARGO_HOME/bin"]; # sessionPath = ["$CARGO_HOME/bin"];

18
modules/home/options.nix Normal file
View file

@ -0,0 +1,18 @@
{ lib, user, config, ... }:
{
options = let
inherit (lib) mkOption;
in
{
kaas = mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "";
};
};
config = {
modules.${user}.themes.enable = config.kaas;
};
}