mwahahahaha, have the orome config building! on to manwe

This commit is contained in:
Chris Kruining 2025-03-18 21:06:40 +01:00
parent 3a2f52f45e
commit af58cfb4ab
30 changed files with 259 additions and 199 deletions

View file

@ -1,3 +0,0 @@
{
ls = "eza -al";
}

View file

@ -6,23 +6,21 @@ let
in
{
imports = [
inputs.sops-nix.nixosModules.sops
# (mkAliasOptionModule ["hm"] ["home-manager" "users" config.user.name])
# (mkAliasOptionModule ["home"] ["hm" "home"])
];
# ++ (mapModulesRec' (toString ./modules) import);
inputs.sops-nix.nixosModules.sops
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
config = {
nix.settings.experimental-features = [ "nix-command" "flakes" ];
environment.variables = {
SNEEUWVLOK = config.sneeuwvlok.dir;
NIXPKGS_ALLOW_UNFREE = "1";
};
environment.variables = {
NIXPKGS_ALLOW_UNFREE = "1";
};
sops = {
defaultSopsFile = ./secrets/secrets.yml;
defaultSopsFormat = "yml";
sops = {
defaultSopsFile = ./secrets/secrets.yml;
defaultSopsFormat = "yml";
age.keyFile = "/home/";
age.keyFile = "/home/";
};
};
}

View file

@ -1,7 +1,5 @@
{ config, lib, pkgs, ... }:
{
user.name = "chris";
fileSystems."/home/chris/games" = {
device = "/dev/disk/by-label/games";
fsType = "ext4";
@ -72,7 +70,6 @@
shell = {
default = "zsh";
corePkgs.enable = true;
};
};
}

View file

@ -2,9 +2,13 @@
{
# full_name = "Chris Kruining";
# is_trusted = true;
themes = {
enable = true;
theme = "everforest";
polarity = "dark";
};
shell = {
default = "zsh";
corePkgs.enable = true;
};
}
}

View file

@ -5,6 +5,5 @@
shell = {
default = "fish";
corePkgs.enable = true;
};
}
}

View file

@ -1,10 +0,0 @@
args@{ lib, pkgs, ... }: let
inherit (lib.my.modules) mapModulesRec';
in
{
imports = []
++ (mapModulesRec' (toString ../modules) (file: import file (args // { user = "chris"; })))
++ (mapModulesRec' (toString ../modules) (file: import file (args // { user = "kaas"; })));
config = {};
}

View file

@ -34,16 +34,15 @@ in rec
configurationRevision = with inputs; mkIf (self ? rev) self.rev;
};
imports = [
imports = [
inputs.home-manager.nixosModules.home-manager
"${path}/hardware.nix"
./_users.nix
]
++ (mapModulesRec' (toString ../modules/system) import);
users = {
mutableUsers = true; # Set this to false when I get sops with passwords set up properly
# users = mapModules "${path}/users" mkSysUser;
users = mapModules "${path}/users" mkSysUser;
};
home-manager = {
@ -53,12 +52,20 @@ in rec
inputs.plasma-manager.homeManagerModules.plasma-manager
];
# users = mapModules "${path}/users" (p: mkHmUser p stateVersion);
users = mapModules "${path}/users" (p: mkHmUser p stateVersion);
};
}
{
modules.chris = (import "${path}/user/chris/default.nix");
modules.kaas = (import "${path}/user/kaas/default.nix");
_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)
../. # ../default.nix

View file

@ -5,7 +5,10 @@
in rec
{
mkSysUser = path: let
user = import path {};
user = {
full_name = "TODO";
is_trusted = true;
};
name = removeSuffix ".nix" (baseNameOf path);
in
{

View file

@ -27,7 +27,7 @@ in {
};
config = mkMerge [
(mkIf (config.modules.desktop.type == "wayland") {
(mkIf (config.modules.${user}.desktop.type == "wayland") {
environment.variables.MOZ_ENABLE_WAYLAND = "1";
})

View file

@ -27,7 +27,7 @@ in {
};
config = mkMerge [
(mkIf (config.modules.desktop.type == "wayland") {
(mkIf (config.modules.${user}.desktop.type == "wayland") {
environment.variables.MOZ_ENABLE_WAYLAND = "1";
})

View file

@ -3,18 +3,18 @@ let
inherit (lib.meta) getExe;
inherit (lib.modules) mkIf;
cfg = options.modules.${user}.desktop.editors.nvim;
cfg = config.modules.${user}.desktop.editors.nvim;
in
{
imports = [
inputs.nvf.nixosModules.default
];
options.modules.${user}.desktop.editors.nvim = let
inherit (lib.options) mkEnableOption;
in { enable = mkEnableOption "neo-vim (nixvim)"; };
in {
enable = mkEnableOption "neo-vim (nixvim)";
};
config = mkIf cfg.enable {
modules.desktop.editors.nvim.enable = true;
home-manager.users.${user}.programs.nvf = {
enable = true;
settings = {

View file

@ -14,8 +14,8 @@ in {
inherit (lib.options) mkEnableOption;
in { enable = mkEnableOption "OpenGL terminal emulator"; };
config = mkIf config.${user}.modules.desktop.terminal.alacritty.enable {
modules.shell.toolset.tmux.enable = true;
config = mkIf config.modules.${user}.desktop.terminal.alacritty.enable {
modules.${user}.shell.toolset.tmux.enable = true;
home-manager.users.${user}.programs.alacritty = {
enable = true;

View file

@ -21,8 +21,8 @@ in
})
(mkIf config.modules.develop.xdg.enable {
home = {
};
# home = {
# };
})
];
}

View file

@ -22,23 +22,17 @@ in
(mkIf (cfg.default != null) {
users.defaultUserShell = pkgs."${cfg.default}";
modules.shell.toolset.gnupg.enable = true;
# modules.${user}.shell.toolset.gnupg.enable = true;
})
(mkIf cfg.corePkgs.enable {
modules.shell.toolset = {
modules.${user}.shell.toolset = {
btop.enable = true;
fzf.enable = true;
starship.enable = true;
tmux.enable = true;
};
home-manager.users.${user}.programs.direnv = {
enable = true;
nix-direnv.enable = true;
config.whitelist.prefix = ["/home"];
};
user.packages = attrValues {
inherit (pkgs) any-nix-shell pwgen yt-dlp ripdrag yazi;
inherit (pkgs) bat fd zoxide;
@ -47,6 +41,12 @@ in
};
home-manager.users.${user}.programs = {
direnv = {
enable = true;
nix-direnv.enable = true;
config.whitelist.prefix = ["/home"];
};
bat.enable = true;
eza.enable = true;
fzf.enable = true;

View file

@ -1,4 +1,4 @@
{ config, options, lib, pkgs, ... }:
{ config, options, lib, pkgs, user, ... }:
let
inherit (lib.attrsets) optionalAttrs;
inherit (lib.modules) mkIf;
@ -10,7 +10,7 @@ in
config = mkIf config.modules.${user}.shell.toolset.fzf.enable {
home-manager.users.${user}.programs.fzf = let
defShell = config.modules.shell.default;
defShell = config.modules.${user}.shell.default;
in {
enable = true;
enableBashIntegration = true;

View file

@ -14,7 +14,7 @@ in
inherit (pkgs) act dura lazygit;
inherit (pkgs.gitAndTools) gh git-open;
}
// optionalAttrs config.modules.shell.toolset.gnupg.enable {
// optionalAttrs config.modules.${user}.shell.toolset.gnupg.enable {
inherit (pkgs.gitAndTools) git-crypt;
});

View file

@ -1,4 +1,4 @@
{ config, options, lib, pkgs, ... }:
{ config, options, lib, pkgs, user, ... }:
let
inherit (builtins) getEnv;
inherit (lib.modules) mkIf;
@ -8,23 +8,31 @@ in
{
options.modules.${user}.shell.toolset.gnupg = let
inherit (lib.options) mkEnableOption;
in { enable = mkEnableOption "cryptographic suite"; };
in {
enable = mkEnableOption "cryptographic suite";
};
config = mkIf cfg.enable {
user.package = with pkgs; [ gnupg ];
config = mkIf config.modules.shell.toolset.gnupg.enable {
environment.variables.GNUPGHOME = "$XDG_CONFIG_HOME/gnupg";
home-manager.users.${user}.programs.gnupg.agent = {
home-manager.users.${user}.programs.gnupg = {
enable = true;
enableSSHSupport = true;
pinentryPackage = pkgs.pinentry-gnome3;
settings = let
cacheTTL = 86400;
in {
default-cache-ttl = cacheTTL;
default-cache-ttl-ssh = cacheTTL;
max-cache-ttl = cacheTTL;
max-cache-ttl-ssh = cacheTTL;
agent = {
enable = true;
enableSSHSupport = true;
pinentryPackage = pkgs.pinentry-gnome3;
settings = let
cacheTTL = 86400;
in {
default-cache-ttl = cacheTTL;
default-cache-ttl-ssh = cacheTTL;
max-cache-ttl = cacheTTL;
max-cache-ttl-ssh = cacheTTL;
};
};
};
};

View file

@ -1,99 +1,104 @@
{ config, options, pkgs, lib, ... }:
{ config, options, pkgs, lib, user, ... }:
let
inherit (lib.attrsets) mapAttrsToList;
inherit (lib.modules) mkIf;
inherit (lib.strings) concatStrings escapeNixString;
cfg = config.modules.shell;
cfg = config.modules.${user}.shell;
in
{
config = mkIf (cfg.default == "zsh") {
modules.shell = {
corePkgs.enable = true;
toolset = {
starship.enable = true;
};
};
modules.shell.zsh.enable = true;
home-manager.users.${user}.programs.starship.enableZshIntegration = true;
modules.${user}.shell = {
corePkgs.enable = true;
};
# Enable completion for sys-packages:
environment.pathsToLink = ["/share/zsh"];
home-manager.users.${user}.programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
history = {
size = 10000;
path = "$XDG_CONFIG_HOME/zsh/history";
home-manager.users.${user} = {
xdg.configFile."zsh-abbreviations" = {
target = "zsh/abbreviations";
text = let
abbrevs = {
ls = "eza -al";
};
in ''
${concatStrings (mapAttrsToList
(k: v: "abbr ${k}=${escapeNixString v}")
abbrevs
)}
'';
};
oh-my-zsh = {
enable = true;
plugins = ["git" "docker-compose" "zoxide"];
};
programs = {
starship.enableZshIntegration = true;
plugins = let
mkZshPlugin = {
pkg,
file ? "${pkg.pname}.plugin.zsh",
}: {
name = pkg.pname;
src = pkg.src;
inherit file;
zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
history = {
size = 10000;
path = "$XDG_CONFIG_HOME/zsh/history";
};
oh-my-zsh = {
enable = true;
plugins = ["git" "docker-compose" "zoxide"];
};
plugins = let
mkZshPlugin = {
pkg,
file ? "${pkg.pname}.plugin.zsh",
}: {
name = pkg.pname;
src = pkg.src;
inherit file;
};
in
with pkgs; [
(mkZshPlugin {pkg = zsh-abbr;})
(mkZshPlugin {pkg = zsh-autopair;})
(mkZshPlugin {pkg = zsh-you-should-use;})
(mkZshPlugin {
pkg = zsh-nix-shell;
file = "nix-shell.plugin.zsh";
})
{
name = "zsh-autosuggestion";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-autosuggestions";
rev = "v0.7.0";
sha256 = "1g3pij5qn2j7v7jjac2a63lxd97mcsgw6xq6k5p7835q9fjiid98";
};
}
{
name = "zsh-completions";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-completions";
rev = "0.34.0";
sha256 = "0jjgvzj3v31yibjmq50s80s3sqi4d91yin45pvn3fpnihcrinam9";
};
}
{
name = "zsh-syntax-highlighting";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-syntax-highlighting";
rev = "0.7.0";
sha256 = "0s1z3whzwli5452h2yzjzzj27pf1hd45g223yv0v6hgrip9f853r";
};
}
];
};
in
with pkgs; [
(mkZshPlugin {pkg = zsh-abbr;})
(mkZshPlugin {pkg = zsh-autopair;})
(mkZshPlugin {pkg = zsh-you-should-use;})
(mkZshPlugin {
pkg = zsh-nix-shell;
file = "nix-shell.plugin.zsh";
})
{
name = "zsh-autosuggestion";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-autosuggestions";
rev = "v0.7.0";
sha256 = "1g3pij5qn2j7v7jjac2a63lxd97mcsgw6xq6k5p7835q9fjiid98";
};
}
{
name = "zsh-completions";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-completions";
rev = "0.34.0";
sha256 = "0jjgvzj3v31yibjmq50s80s3sqi4d91yin45pvn3fpnihcrinam9";
};
}
{
name = "zsh-syntax-highlighting";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-syntax-highlighting";
rev = "0.7.0";
sha256 = "0s1z3whzwli5452h2yzjzzj27pf1hd45g223yv0v6hgrip9f853r";
};
}
];
};
home-manager.users.${user}.xdg.configFile."zsh-abbreviations" = {
target = "zsh/abbreviations";
text = let
abbrevs = import "${config.sneeuwvlok.configDir}/shell-abbr";
in ''
${concatStrings (mapAttrsToList
(k: v: "abbr ${k}=${escapeNixString v}")
abbrevs
)}
'';
};
};
};
}

View file

@ -9,9 +9,6 @@ let
cfg = config.modules.${user}.themes;
desktop = config.modules.${user}.desktop;
in {
imports = [
inputs.stylix.nixosModules.stylix
];
options.modules.${user}.themes = let
inherit (lib.options) mkOption mkEnableOption;
@ -34,6 +31,8 @@ in {
};
config = mkIf (cfg.enable) {
modules.theming.enable = true;
stylix = {
enable = true;

View file

@ -0,0 +1,22 @@
{ inputs, config, options, lib, pkgs, ... }:
let
inherit (lib.meta) getExe;
inherit (lib.modules) mkIf;
cfg = options.modules.desktop.editors.nvim;
in
{
imports = [
inputs.nvf.nixosModules.default
];
options.modules.desktop.editors.nvim = let
inherit (lib.options) mkEnableOption;
in {
enable = mkEnableOption "neo-vim (nixvim)";
};
config = mkIf cfg.enable {
};
}

View file

@ -27,7 +27,5 @@ in {
wifi.backend = "wpa_supplicant";
};
};
hm.services.network-manager-applet.enable = true;
};
}

View file

@ -11,34 +11,9 @@ in
in
{
user = mkOpt attrs {};
sneeuwvlok = {
dir = mkOpt path (findFirst pathExists (toString ../.) [
"${config.user.home}/Github/sneeuwvlok"
]);
hostDir = mkOpt path "${config.sneeuwvlok.dir}/hosts/${config.networking.hostName}";
configDir = mkOpt path "${config.sneeuwvlok.dir}/config";
modulesDir = mkOpt path "${config.sneeuwvlok.dir}/modules";
themesDir = mkOpt path "${config.sneeuwvlok.modulesDir}/themes";
};
};
config = {
# user = {
# name = "chris";
# description = "Chris Kruining";
# extraGroups = [ "wheel" ];
# isNormalUser = true;
# home = "/home/chris";
# group = "users";
# uid = 1000;
# };
# users.users.${config.user.name} = mkAliasDefinitions options.user;
# Temp solution...
# home-manager.users.${config.user.name}.home.stateVersion = "23.11";
nix.settings = let
inherit (lib) elem attrNames filterAttrs;

View file

@ -5,7 +5,5 @@ in
{
options.modules.services = let
inherit (lib.options) mkEnableOption;
in {
enable = mkEnableOption "Enable all services";
};
in {};
}

View file

@ -125,10 +125,7 @@ in
networking.firewall.allowedTCPPorts = [ 80 443 ];
modules.virtualisation = {
enable = true;
podman.enable = true;
};
modules.virtualisation.podman.enable = true;
virtualisation = {
oci-containers = {

View file

@ -1,6 +1,8 @@
{ config, options, lib, pkgs, ... }:
let
inherit (lib.modules) mkIf;
user = "nextcloud";
in
{
options.modules.services.nextcloud = let
@ -10,7 +12,14 @@ in
};
config = mkIf config.modules.services.nextcloud.enable {
home.file.".netrc".text = ''
users.users.${user} = {
name = user;
isSystemUser = true;
home = "/home/${user}";
group = user;
};
home-manager.users.${user}.home.file.".netrc".text = ''
login root
password KaasIsAwesome!
'';
@ -23,7 +32,7 @@ in
};
Service = {
Type = "simple";
ExecStart = "${pkgs.nextcloud-client}/bin/nextcloudcmd -h -n --path /var/music /home/chris/Music https://cloud.kruining.eu";
ExecStart = "${pkgs.nextcloud-client}/bin/nextcloudcmd -h -n --path /var/music /home/${user}/Music https://cloud.kruining.eu";
TimeoutStopSec = "180";
KillMode = "process";
KillSignal = "SIGINT";

View file

@ -0,0 +1,15 @@
{ config, options, lib, pkgs, ... }:
let
inherit (lib.attrsets) attrValues;
inherit (lib.modules) mkIf;
cfg = config.modules.shell;
in
{
options.modules.shell = let
inherit (lib.options) mkEnableOption;
in
{};
config = mkIf cfg.enable {};
}

View file

@ -0,0 +1,19 @@
{ config, options, lib, pkgs, ... }:
let
inherit (lib.attrsets) attrValues;
inherit (lib.modules) mkIf;
cfg = config.modules.shell.zsh;
in
{
options.modules.shell.zsh = let
inherit (lib.options) mkEnableOption;
in
{
enable = mkEnableOption "enable ZSH";
};
config = mkIf cfg.enable {
programs.zsh.enable = true;
};
}

View file

@ -0,0 +1,22 @@
{ inputs, config, options, lib, pkgs, ... }:
let
inherit (lib) mkIf;
cfg = config.modules.theming;
in
{
imports = [
inputs.stylix.nixosModules.stylix
];
options.modules.theming = let
inherit (lib.options) mkEnableOption;
in
{
enable = mkEnableOption "enable theming";
};
config = mkIf cfg.enable {
};
}

View file

@ -6,7 +6,5 @@ in
options.modules.virtualisation = let
inherit (lib.options) mkEnableOption;
in
{
enable = mkEnableOption "enable virtualisation";
};
{};
}