move the config' arg to a custom module (big)

shoutout to raf for pointing out how retarded this was
this was needed very much
This commit is contained in:
jacekpoz 2024-02-29 00:29:56 +01:00
parent e620abfe05
commit 59febb2149
No known key found for this signature in database
GPG key ID: 94E812A8B12AAE3C
40 changed files with 178 additions and 148 deletions

View file

@ -1,9 +1,11 @@
{
config,
inputs,
pkgs,
config',
...
}: {
}: let
username = config.myOptions.other.system.username;
in {
nixpkgs = {
# fuck broadcom
config.allowUnfree = true;
@ -24,12 +26,10 @@
];
trusted-users = [
"root"
config'.username
username
];
};
networking.hostName = config'.hostname;
programs.zsh.enable = true;
programs.direnv = {
@ -37,9 +37,8 @@
nix-direnv.enable = true;
};
users.users.${config'.username} = {
isNormalUser = true;
extraGroups = [ "wheel" "docker" ];
users.users.${username} = {
extraGroups = [ "docker" ];
packages = with pkgs; [
curl
neovim
@ -92,6 +91,12 @@
networking.firewall.allowedTCPPorts = [ 80 443 22 ];
myOptions = {
other = {
system = {
hostname = "chmura";
username = "chmura";
};
};
programs = {
git = {
enable = true;

View file

@ -1,16 +1,18 @@
{
config,
lib,
inputs,
pkgs,
self,
config',
...
}: {
}: let
username = config.myOptions.other.system.username;
in {
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = {inherit inputs self config';};
users.${config'.username} = {
extraSpecialArgs = {inherit inputs self;};
users.${username} = {
programs = {
home-manager.enable = true;
direnv = {
@ -20,8 +22,8 @@
};
home = {
inherit (config') username;
homeDirectory = "/home/${config'.username}";
inherit username;
homeDirectory = "/home/${username}";
packages = with pkgs; [
git
eza

View file

@ -9,10 +9,6 @@ in {
system = "x86_64-linux";
specialArgs = {
inherit lib inputs self;
config' = {
hostname = "niks";
username = "jacek";
};
};
modules = [
./niks
@ -25,10 +21,6 @@ in {
system = "x86_64-linux";
specialArgs = {
inherit lib inputs self;
config' = {
hostname = "del";
username = "jacek";
};
};
modules = [
./del
@ -41,10 +33,6 @@ in {
# system = "x86_64-linux";
# specialArgs = {
# inherit lib inputs self;
# config' = {
# hostname = "hape";
# username = "jacek";
# };
# };
# modules = [
# ./hape
@ -56,10 +44,6 @@ in {
system = "x86_64-linux";
specialArgs = {
inherit lib inputs self;
config' = {
hostname = "chmura";
username = "chmura";
};
};
modules = [
./chmura

View file

@ -1,6 +1,5 @@
{
config,
config',
pkgs,
lib,
inputs,
@ -33,7 +32,6 @@
};
networking = {
hostName = config'.hostname;
networkmanager = {
enable = true;
dns = "systemd-resolved";
@ -82,9 +80,8 @@
security.polkit.enable = true;
users.users.${config'.username} = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "libvirtd" "video" ];
users.users.${config.myOptions.other.system.username} = {
extraGroups = [ "networkmanager" "libvirtd" "video" ];
};
environment = {
@ -192,6 +189,10 @@
myOptions = {
other = {
system = {
hostname = "del";
username = "jacek";
};
home-manager = {
enable = true;
enableDirenv = true;
@ -327,51 +328,53 @@
daemon.enable = false;
agent = {
enable = true;
hostAliases = {
hostAliases = let
username = config.myOptions.other.system.username;
in {
"github" = {
hostName = "github.com";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/githubkey";
identityFile = "${config.home-manager.users.${username}.home.homeDirectory}/.ssh/githubkey";
};
"git.dupa.edu.pl" = {
hostName = "git.dupa.edu.pl";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/gitdupaedupl";
identityFile = "${config.home-manager.users.${username}.home.homeDirectory}/.ssh/gitdupaedupl";
};
"codeberg" = {
hostName = "codeberg.org";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/codeberg";
identityFile = "${config.home-manager.users.${username}.home.homeDirectory}/.ssh/codeberg";
};
"gitlab" = {
hostName = "gitlab.com";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/gitlab";
identityFile = "${config.home-manager.users.${username}.home.homeDirectory}/.ssh/gitlab";
};
"aur" = {
hostName = "aur.archlinux.org";
user = "aur";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/aur";
identityFile = "${config.home-manager.users.${username}.home.homeDirectory}/.ssh/aur";
};
"jacekpoz" = {
hostName = "git.jacekpoz.pl";
user = "forgejo";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/jacekpoz";
identityFile = "${config.home-manager.users.${username}.home.homeDirectory}/.ssh/jacekpoz";
};
"chmura" = {
hostName = "192.168.15.2";
user = "chmura";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/chmura";
identityFile = "${config.home-manager.users.${username}.home.homeDirectory}/.ssh/chmura";
};
"chmura2" = {
hostName = "jacekpoz.pl";
user = "chmura";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/chmura";
identityFile = "${config.home-manager.users.${username}.home.homeDirectory}/.ssh/chmura";
};
"malina" = {
hostName = "192.168.15.3";
user = "malina";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/malina";
identityFile = "${config.home-manager.users.${username}.home.homeDirectory}/.ssh/malina";
};
"outfoxxed" = {
hostName = "git.outfoxxed.me";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/outfoxxed";
identityFile = "${config.home-manager.users.${username}.home.homeDirectory}/.ssh/outfoxxed";
};
};
};

View file

@ -1,11 +1,12 @@
{
config,
config',
inputs,
pkgs,
...
}: {
home-manager.users.${config'.username} = {
}: let
username = config.myOptions.other.system.username;
in {
home-manager.users.${username} = {
home.packages = let
hyprcontrib = inputs.hyprcontrib.packages.${pkgs.system};
shadower = inputs.shadower.packages.${pkgs.system};

View file

@ -3,9 +3,10 @@
pkgs,
lib,
inputs,
config',
...
}: {
}: let
username = config.myOptions.other.system.username;
in {
nixpkgs = {
config.allowUnfree = true;
overlays = [
@ -41,7 +42,6 @@
};
networking = {
hostName = config'.hostname;
networkmanager.enable = true;
firewall.checkReversePath = "loose";
};
@ -105,9 +105,8 @@
noto-fonts-emoji
];
users.users.${config'.username} = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "libvirtd" ];
users.users.${username} = {
extraGroups = [ "networkmanager" "libvirtd" ];
shell = pkgs.zsh;
};

View file

@ -1,16 +1,18 @@
{
config',
config,
inputs,
lib,
pkgs,
self,
...
}: {
}: let
username = config.myOptions.other.system.username;
in {
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = {inherit inputs self config';};
users.${config'.username} = {
extraSpecialArgs = {inherit inputs self;};
users.${username} = {
programs = {
home-manager.enable = true;
direnv = {
@ -20,8 +22,8 @@
};
home = {
inherit (config') username;
homeDirectory = "/home/${config'.username}";
inherit username;
homeDirectory = "/home/${username}";
packages = let
hyprcontrib = inputs.hyprcontrib.packages.${pkgs.system};
shadower = inputs.shadower.packages.${pkgs.system};

View file

@ -1,6 +1,5 @@
{
config,
config',
pkgs,
lib,
inputs,
@ -40,7 +39,6 @@
};
networking = {
hostName = config'.hostname;
networkmanager = {
enable = true;
dns = "systemd-resolved";
@ -103,9 +101,8 @@
security.polkit.enable = true;
users.users.${config'.username} = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "libvirtd" ];
users.users.${config.myOptions.other.system.username} = {
extraGroups = [ "networkmanager" "libvirtd" ];
};
environment = {
@ -182,6 +179,10 @@
myOptions = {
other = {
system = {
hostname = "niks";
username = "jacek";
};
home-manager = {
enable = true;
enableDirenv = true;
@ -318,51 +319,53 @@
daemon.enable = false;
agent = {
enable = true;
hostAliases = {
hostAliases = let
username = config.myOptions.other.system.username;
in {
"github" = {
hostName = "github.com";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/githubkey";
identityFile = "${config.home-manager.users.${username}.home.homeDirectory}/.ssh/githubkey";
};
"git.dupa.edu.pl" = {
hostName = "git.dupa.edu.pl";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/gitdupaedupl";
identityFile = "${config.home-manager.users.${username}.home.homeDirectory}/.ssh/gitdupaedupl";
};
"codeberg" = {
hostName = "codeberg.org";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/codeberg";
identityFile = "${config.home-manager.users.${username}.home.homeDirectory}/.ssh/codeberg";
};
"gitlab" = {
hostName = "gitlab.com";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/gitlab";
identityFile = "${config.home-manager.users.${username}.home.homeDirectory}/.ssh/gitlab";
};
"aur" = {
hostName = "aur.archlinux.org";
user = "aur";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/aur";
identityFile = "${config.home-manager.users.${username}.home.homeDirectory}/.ssh/aur";
};
"jacekpoz" = {
hostName = "git.jacekpoz.pl";
user = "forgejo";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/jacekpoz";
identityFile = "${config.home-manager.users.${username}.home.homeDirectory}/.ssh/jacekpoz";
};
"chmura" = {
hostName = "192.168.15.2";
user = "chmura";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/chmura";
identityFile = "${config.home-manager.users.${username}.home.homeDirectory}/.ssh/chmura";
};
"chmura2" = {
hostName = "jacekpoz.pl";
user = "chmura";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/chmura";
identityFile = "${config.home-manager.users.${username}.home.homeDirectory}/.ssh/chmura";
};
"malina" = {
hostName = "192.168.15.3";
user = "malina";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/malina";
identityFile = "${config.home-manager.users.${username}.home.homeDirectory}/.ssh/malina";
};
"outfoxxed" = {
hostName = "git.outfoxxed.me";
identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/outfoxxed";
identityFile = "${config.home-manager.users.${username}.home.homeDirectory}/.ssh/outfoxxed";
};
};
};

View file

@ -1,11 +1,12 @@
{
config,
config',
inputs,
pkgs,
...
}: {
home-manager.users.${config'.username} = {
}: let
username = config.myOptions.other.system.username;
in {
home-manager.users.${username} = {
home.packages = let
hyprcontrib = inputs.hyprcontrib.packages.${pkgs.system};
shadower = inputs.shadower.packages.${pkgs.system};

View file

@ -1,11 +1,11 @@
{
config,
config',
lib,
pkgs,
...
}: with lib; let
cfg = config.myOptions.programs.git;
username = config.myOptions.other.system.username;
in {
options.myOptions.programs.git = {
enable = mkEnableOption "git";
@ -34,7 +34,7 @@ in {
};
config = mkIf cfg.enable {
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
programs.git = {
inherit (cfg) enable userName userEmail;
signing = {

View file

@ -1,15 +1,15 @@
{
config,
config',
lib,
...
}: with lib; let
cfg = config.myOptions.programs.starship;
username = config.myOptions.other.system.username;
in {
options.myOptions.programs.starship.enable = mkEnableOption "enable starship";
config = mkIf cfg.enable {
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
programs.starship = {
enable = true;
enableZshIntegration = config.myOptions.programs.zsh.enable;

View file

@ -1,11 +1,11 @@
{
config,
config',
lib,
pkgs,
...
}: with lib; let
cfg = config.myOptions.programs.zsh;
username = config.myOptions.other.system.username;
in {
options.myOptions.programs.zsh = {
enable = mkEnableOption "enable zsh";
@ -24,14 +24,14 @@ in {
config = mkIf cfg.enable {
programs.zsh.enable = true;
users.users.${config'.username}.shell = pkgs.zsh;
users.users.${username}.shell = pkgs.zsh;
environment = {
shells = [ pkgs.zsh ];
pathsToLink = [ "/share/zsh" ];
};
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
programs.zsh = {
enable = true;
shellAliases = {
@ -60,7 +60,7 @@ in {
initExtraFirst = mkIf cfg.profiling "zmodload zsh/zprof";
initExtra = mkIf cfg.profiling "zprof";
history = {
path = "${config.home-manager.users.${config'.username}.xdg.dataHome}/zsh/zsh_history";
path = "${config.home-manager.users.${username}.xdg.dataHome}/zsh/zsh_history";
size = 9999999999;
save = 9999999999;
extended = true;

View file

@ -1,12 +1,12 @@
{
config,
config',
inputs,
lib,
pkgs,
...
}: with lib; let
cfg = config.myOptions.programs.anyrun;
username = config.myOptions.other.system.username;
in {
options.myOptions.programs.anyrun.enable = mkEnableOption "enable anyrun";
@ -15,7 +15,7 @@ in {
substituters = [ "https://anyrun.cachix.org" ];
trusted-public-keys = [ "anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s=" ];
};
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
imports = [ inputs.anyrun.homeManagerModules.default ];
programs.anyrun = {

View file

@ -1,11 +1,12 @@
{
config,
config',
lib,
pkgs,
...
}: with lib; let
cfg = config.myOptions.programs.armcord;
username = config.myOptions.other.system.username;
storage = "ArmCord/storage";
in {
options.myOptions.programs.armcord = {
@ -13,7 +14,7 @@ in {
};
config = mkIf cfg.enable {
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
home.packages = with pkgs; [
(armcord.overrideAttrs (old: {
postFixup = ''

View file

@ -1,10 +1,10 @@
{
config,
config',
lib,
...
}: with lib; let
cfg = config.myOptions.themes.cursor;
username = config.myOptions.other.system.username;
in {
options.myOptions.themes.cursor = {
enable = mkEnableOption "enable cursor theming";
@ -28,7 +28,7 @@ in {
XCURSOR_SIZE = "${toString cfg.size}";
};
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
home.pointerCursor = {
inherit (cfg) package name size;
gtk.enable = true;

View file

@ -1,11 +1,11 @@
{
config,
config',
lib,
pkgs,
...
}: with lib; let
cfg = config.myOptions.programs.firefox;
username = config.myOptions.other.system.username;
buildFirefoxXpiAddon = lib.makeOverridable ({
stdenv ? pkgs.stdenv,
@ -92,7 +92,7 @@ in {
};
config = mkIf cfg.enable {
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
xdg.desktopEntries = {
firefox-schizo = {
name = "Schizofox";

View file

@ -1,12 +1,12 @@
{
config,
config',
inputs,
lib,
pkgs,
...
}: with lib; let
cfg = config.myOptions.programs.foot;
username = config.myOptions.other.system.username;
in {
options.myOptions.programs.foot = {
enable = mkEnableOption "enable foot";
@ -21,7 +21,7 @@ in {
environment.sessionVariables = {
TERM = "foot";
};
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
programs.foot = {
enable = true;
package = inputs.nixpkgs-wayland.packages.${pkgs.system}.foot;

View file

@ -1,11 +1,11 @@
{
config,
config',
lib,
...
}: with lib; let
cfg = config.myOptions.themes.gtk;
hmCfg = config.home-manager.users.${config'.username};
username = config.myOptions.other.system.username;
hmCfg = config.home-manager.users.${username};
in {
options.myOptions.themes.gtk = {
enable = mkEnableOption "enable gtk theming";
@ -43,7 +43,7 @@ in {
};
config = mkIf cfg.enable {
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
gtk = {
enable = true;
theme = {

View file

@ -1,11 +1,11 @@
{
config,
config',
lib,
pkgs,
...
}: with lib; let
cfg = config.myOptions.programs.gtklock;
username = config.myOptions.other.system.username;
in {
options.myOptions.programs.gtklock.enable = mkEnableOption "enable gtklock";
@ -14,7 +14,7 @@ in {
# https://github.com/NixOS/nixpkgs/issues/158025
security.pam.services.gtklock.text = "auth include login";
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
home.packages = with pkgs; [
gtklock
];

View file

@ -1,12 +1,12 @@
{
config,
config',
inputs,
lib,
pkgs,
...
}: with lib; let
cfg = config.myOptions.programs.hyprland;
username = config.myOptions.other.system.username;
osuCfg = config.myOptions.programs.osu;
inherit (inputs.nixpkgs-wayland.packages.${pkgs.system}) foot wl-clipboard swww wlsunset swaylock;
@ -64,7 +64,7 @@ in {
config.common.default = "*";
};
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
# TODO swap back to this whenever fufexan or anyone else
# adds an equivalent of hm's settings to this module
#imports = [ inputs.hyprland.homeManagerModules.default ];
@ -83,9 +83,9 @@ in {
# and make this file stop hanging my neovim every 2 seconds
# and figure out why it triggers E79 every single time I edit something
extraConfig = ''
bind=$mainMod, W, exec, ${removeSuffix " %U" config.home-manager.users.${config'.username}.xdg.desktopEntries.firefox-schizo.exec}
bind=$mainMod SHIFT, W, exec, ${removeSuffix " %U" config.home-manager.users.${config'.username}.xdg.desktopEntries.firefox-unschizo.exec}
${if (cfg.startupSound != "") then "exec-once=${pkgs.mpv}/bin/mpv --no-video --volume=100 ${config.home-manager.users.${config'.username}.xdg.dataHome}/hypr/startup_sound" else ""}
bind=$mainMod, W, exec, ${removeSuffix " %U" config.home-manager.users.${username}.xdg.desktopEntries.firefox-schizo.exec}
bind=$mainMod SHIFT, W, exec, ${removeSuffix " %U" config.home-manager.users.${username}.xdg.desktopEntries.firefox-unschizo.exec}
${if (cfg.startupSound != "") then "exec-once=${pkgs.mpv}/bin/mpv --no-video --volume=100 ${config.home-manager.users.${username}.xdg.dataHome}/hypr/startup_sound" else ""}
'';
settings = {
"$mainMod" = "SUPER";

View file

@ -1,16 +1,16 @@
{
config,
config',
lib,
pkgs,
...
}: with lib; let
cfg = config.myOptions.programs.mpv;
username = config.myOptions.other.system.username;
in {
options.myOptions.programs.mpv.enable = mkEnableOption "enable mpv";
config = mkIf cfg.enable {
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
programs.mpv = {
enable = true;
config = {

View file

@ -1,12 +1,12 @@
{
config,
config',
inputs,
lib,
pkgs,
...
}: with lib; let
cfg = config.myOptions.programs.osu;
username = config.myOptions.other.system.username;
in {
options.myOptions.programs.osu = {
enable = mkEnableOption "enable osu!";
@ -23,7 +23,7 @@ in {
];
};
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
home.packages = with inputs.nix-gaming.packages.${pkgs.system}; [
(mkIf cfg.enable
osu-lazer-bin)

View file

@ -1,11 +1,11 @@
{
config,
config',
lib,
pkgs,
...
}: with lib; let
cfg = config.myOptions.themes.qt;
username = config.myOptions.other.system.username;
in {
options.myOptions.themes.qt = {
enable = mkEnableOption "enable qt theming";
@ -32,7 +32,7 @@ in {
QT_QPA_PLATFORMTHEME = "qt5ct";
};
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
# thanks raf :3 https://github.com/NotAShelf/nyx/blob/main/homes/notashelf/themes/qt.nix
qt = {
enable = true;

View file

@ -1,18 +1,18 @@
{
config,
config',
inputs,
lib,
...
}: with lib; let
cfg = config.myOptions.programs.schizofox;
username = config.myOptions.other.system.username;
in {
options.myOptions.programs.schizofox = {
enable = mkEnableOption "enable schizofox";
};
config = mkIf cfg.enable {
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
imports = [ inputs.schizofox.homeManagerModule ];
programs.schizofox = {

View file

@ -1,12 +1,12 @@
{
config,
config',
inputs,
lib,
pkgs,
...
}: with lib; let
cfg = config.myOptions.programs.swaylock;
username = config.myOptions.other.system.username;
in {
options.myOptions.programs.swaylock.enable = mkEnableOption "enable swaylock";
@ -15,7 +15,7 @@ in {
# https://github.com/NixOS/nixpkgs/issues/158025
security.pam.services.swaylock.text = "auth include login";
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
programs.swaylock = {
enable = true;
package = inputs.nixpkgs-wayland.packages.${pkgs.system}.swaylock-effects;

View file

@ -1,18 +1,18 @@
{
config,
config',
lib,
pkgs,
...
}: with lib; let
cfg = config.myOptions.programs.vesktop;
username = config.myOptions.other.system.username;
in {
options.myOptions.programs.vesktop = {
enable = mkEnableOption "enable vesktop";
};
config = mkIf cfg.enable {
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
home.packages = with pkgs; [
(vesktop.overrideAttrs (old: {
patches = (old.patches or []) ++ [ ./readonlyFix.patch ];

View file

@ -1,17 +1,17 @@
{
config,
config',
inputs,
lib,
pkgs,
...
}: with lib; let
cfg = config.myOptions.programs.waybar;
username = config.myOptions.other.system.username;
in {
options.myOptions.programs.waybar.enable = mkEnableOption "enable waybar";
config = mkIf cfg.enable {
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
programs.waybar = {
enable = true;
package = inputs.waybar.packages.${pkgs.system}.waybar;

View file

@ -1,16 +1,16 @@
{
config,
config',
lib,
pkgs,
...
}: with lib; let
cfg = config.myOptions.programs.zathura;
username = config.myOptions.other.system.username;
in {
options.myOptions.programs.zathura.enable = mkEnableOption "enable zathura";
config = mkIf cfg.enable {
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
xdg.configFile."zathura/catppuccin-mocha".source = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/catppuccin/zathura/main/src/catppuccin-mocha";
hash = "sha256-/HXecio3My2eXTpY7JoYiN9mnXsps4PAThDPs4OCsAk=";

View file

@ -1,6 +1,7 @@
_: {
imports = [
./home-manager.nix
./system.nix
./xdg.nix
];
}

View file

@ -1,12 +1,12 @@
{
config,
config',
inputs,
lib,
self,
...
}: with lib; let
cfg = config.myOptions.other.home-manager;
username = config.myOptions.other.system.username;
in {
options.myOptions.other.home-manager = {
enable = mkEnableOption "enable home-manager";
@ -17,8 +17,8 @@ in {
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = {inherit inputs self config';};
users.${config'.username} = {
extraSpecialArgs = {inherit inputs self;};
users.${username} = {
programs = {
home-manager.enable = true;
direnv = mkIf cfg.enableDirenv {
@ -28,8 +28,8 @@ in {
};
home = {
inherit (config') username;
homeDirectory = "/home/${config'.username}";
inherit username;
homeDirectory = "/home/${username}";
stateVersion = lib.mkDefault "23.11";
};
};

28
modules/other/system.nix Normal file
View file

@ -0,0 +1,28 @@
{
config,
lib,
...
}: with lib; let
cfg = config.myOptions.other.system;
in {
options.myOptions.other.system = {
hostname = mkOption {
description = "hostname for this system";
type = types.str;
};
username = mkOption {
description = "username for this system (doesn't support multi user yet)";
type = types.str;
};
};
config = {
networking.hostName = cfg.hostname;
users.users.${cfg.username} = {
isNormalUser = true;
extraGroups = [ "wheel" ];
};
};
}

View file

@ -1,9 +1,9 @@
{
config,
config',
...
}: let
hmCfg = config.home-manager.users.${config'.username};
username = config.myOptions.other.system.username;
hmCfg = config.home-manager.users.${username};
primary_browser = "firefox-schizo.desktop";
secondary_browser = "firefox-unschizo.desktop";
@ -40,7 +40,7 @@ in {
wget = "wget --hsts-file=\"${hmCfg.xdg.dataHome}/wget-hsts\"";
};
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
xdg.configFile."npm/npmrc".text = ''
prefix=${hmCfg.xdg.dataHome}/npm
cache=${hmCfg.xdg.cacheHome}/npm

View file

@ -1,17 +1,17 @@
{
config,
config',
inputs,
lib,
pkgs,
...
}: with lib; let
cfg = config.myOptions.services.dunst;
username = config.myOptions.other.system.username;
in {
options.myOptions.services.dunst.enable = mkEnableOption "enable dunst";
config = mkIf cfg.enable {
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
services.dunst = {
enable = true;
package = inputs.nixpkgs-wayland.packages.${pkgs.system}.dunst;

View file

@ -1,11 +1,11 @@
{
config,
config',
lib,
pkgs,
...
}: with lib; let
cfg = config.myOptions.services.fcitx5;
username = config.myOptions.other.system.username;
in {
# stolen from https://git.outfoxxed.me/outfoxxed/nixnew/src/branch/master/modules/user/modules/fcitx5
options.myOptions.services.fcitx5.enable = mkEnableOption "enable fcitx5";
@ -20,7 +20,7 @@ in {
];
};
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
xdg.configFile = {
"fcitx5/config".text = ''
[Hotkey]

View file

@ -1,12 +1,12 @@
{
config,
config',
inputs,
lib,
pkgs,
...
}: with lib; let
cfg = config.myOptions.services.greetd;
username = config.myOptions.other.system.username;
hyprlandConfig = pkgs.writeText "greetd-hyprland-config" ''
misc {
@ -42,7 +42,7 @@ in {
enable = true;
settings.default_session = {
command = "${inputs.hyprland.packages.${pkgs.system}.hyprland}/bin/Hyprland --config ${hyprlandConfig}";
user = config'.username;
user = username;
};
};

View file

@ -1,15 +1,15 @@
{
config,
config',
lib,
...
}: with lib; let
cfg = config.myOptions.services.mpd;
username = config.myOptions.other.system.username;
in {
options.myOptions.services.mpd.enable = mkEnableOption "enable mpd";
config = mkIf cfg.enable {
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
services = {
mpd = {
enable = true;

View file

@ -1,15 +1,15 @@
{
config,
config',
lib,
...
}: with lib; let
cfg = config.myOptions.programs.btop;
username = config.myOptions.other.system.username;
in {
options.myOptions.programs.btop.enable = mkEnableOption "enable btop";
config = mkIf cfg.enable {
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
programs.btop = {
enable = true;
settings = {

View file

@ -1,12 +1,12 @@
{
config,
config',
lib,
inputs,
pkgs,
...
}: with lib; let
cfg = config.myOptions.programs.helix;
username = config.myOptions.other.system.username;
in {
options.myOptions.programs.helix.enable = mkEnableOption "enable helix";
@ -15,7 +15,7 @@ in {
substituters = [ "https://helix.cachix.org" ];
trusted-public-keys = [ "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=" ];
};
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
programs.helix = {
enable = true;
package = inputs.helix.packages.${pkgs.system}.default.overrideAttrs (self: {

View file

@ -1,6 +1,5 @@
{
config,
config',
inputs,
lib,
pkgs,
@ -8,6 +7,7 @@
}:
with lib; let
cfg = config.myOptions.programs.neovim;
username = config.myOptions.other.system.username;
in {
options.myOptions.programs.neovim.enable = mkEnableOption "enable neovim";
@ -16,7 +16,7 @@ in {
EDITOR = "${pkgs.neovim}/bin/nvim";
};
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
imports = [ inputs.nixvim.homeManagerModules.nixvim ];
programs.nixvim = {

View file

@ -1,15 +1,15 @@
{
config,
config',
lib,
...
}: with lib; let
cfg = config.myOptions.programs.newsboat;
username = config.myOptions.other.system.username;
in {
options.myOptions.programs.newsboat.enable = mkEnableOption "enable newsboat";
config = mkIf cfg.enable {
home-manager.users.${config'.username} = {
home-manager.users.${username} = {
programs.newsboat = {
enable = true;
autoReload = true;