[NixOS] Spread home manager configuration out

This commit is contained in:
Ivan Malison 2023-08-20 02:54:19 -06:00
parent 7337631c4f
commit 057347f1cf
12 changed files with 250 additions and 201 deletions

View File

@ -126,12 +126,15 @@
nixpkgs.lib.nixosSystem (args // {
inherit system;
modules = baseModules ++ modules;
specialArgs = {
specialArgs = rec {
inherit inputs;
myPackages = {
taffybar = inputs.imalison-taffybar.defaultPackage."${system}";
};
makeEnable = (import ./make-enable.nix) nixpkgs.lib;
mapValueToKeys = keys: value: builtins.listToAttrs (map (name: { inherit name value; }) keys);
realUsers = [ "root" "imalison" "kat" "dean" "alex" ];
forEachUser = mapValueToKeys realUsers;
} // specialArgs;
});
machinesFilepath = ./machines;

View File

@ -7,7 +7,10 @@
./desktop.nix
./extra.nix
./games.nix
./git-sync.nix
./internet-computer.nix
./keybase.nix
./nixified.ai.nix
./syncthing.nix
./xmonad.nix
];

43
nixos/git-sync.nix Normal file
View File

@ -0,0 +1,43 @@
{ ... }: {
home-manager.users.imalison = ({ config, ... }: {
services.git-sync = {
enable = true;
repositories = {
config = {
path = config.home.homeDirectory + "/config";
uri = "git@github.com:IvanMalison/config.git";
};
org = {
path = config.home.homeDirectory + "/org";
uri = "git@github.com:IvanMalison/org.git";
};
password-store = {
path = config.home.homeDirectory + "/.password-store";
uri = "git@github.com:IvanMalison/.password-store.git";
};
katnivan = {
path = config.home.homeDirectory + "/katnivan";
uri = "ssh://gitea@1896Folsom.duckdns.org:1123/colonelpanic/katnivan.git";
};
};
};
});
home-manager.users.kat = ({ config, ... }: {
services.git-sync = {
enable = true;
repositories = {
obsidian = {
path = config.home.homeDirectory + "/obsidian";
uri = "git@github.com:katandtonic/obsidian.git";
interval = 60;
};
org = {
path = config.home.homeDirectory + "/org";
uri = "ssh://gitea@1896Folsom.duckdns.org:1123/kkathuang/org.git";
interval = 45;
};
};
};
});
}

View File

@ -1,4 +1,5 @@
{ pkgs, config, specialArgs, ... }: {
username: { pkgs, config, specialArgs, ... }:
{
xsession = {
enable = true;
preferStatusNotifierItems = true;
@ -13,10 +14,6 @@
forwardAgent = true;
};
services.xscreensaver = {
enable = true;
};
programs.gpg.package = pkgs.gnupg_2_4_0;
services.gpg-agent = {
@ -27,140 +24,6 @@
pinentryFlavor = "gnome3";
};
services.blueman-applet = {
enable = true;
};
services.taffybar = {
enable = true;
package = specialArgs.nixos.specialArgs.inputs.imalison-taffybar.defaultPackage."${pkgs.system}";
};
services.notify-osd = {
enable = true;
package = pkgs.notify-osd-customizable;
};
services.kdeconnect = {
enable = true;
indicator = true;
};
services.network-manager-applet.enable = true;
services.udiskie = {
enable = true;
tray = "always";
};
services.status-notifier-watcher.enable = true;
services.autorandr.enable = true;
services.random-background = {
enable = true;
display = "fill";
interval = "1h";
imageDirectory = "%h/Pictures/wallpaper/use";
};
services.xsettingsd.enable = true;
services.volnoti.enable = true;
services.pasystray.enable = true;
services.parcellite = {
enable = true;
package = pkgs.clipit;
};
services.git-sync = {
enable = true;
repositories = {
config = {
path = config.home.homeDirectory + "/config";
uri = "git@github.com:IvanMalison/config.git";
};
org = {
path = config.home.homeDirectory + "/org";
uri = "git@github.com:IvanMalison/org.git";
};
password-store = {
path = config.home.homeDirectory + "/.password-store";
uri = "git@github.com:IvanMalison/.password-store.git";
};
};
};
services.picom = {
enable = true;
vSync = false;
backend = "glx";
extraArgs = ["--experimental-backends"];
settings = {
animations = true;
animation-window-mass = 1;
animation-dampening = 20;
animation-stiffness = 250;
animation-clamping = false;
animation-for-open-window = "zoom";
animation-for-unmap-window = "zoom";
animation-for-transient-window = "slide-down";
fade-in-step = 0.028;
fade-out-step = 0.028;
fading = true;
};
wintypes = {
dock = {animation = "slide-down";};
toolbar = {animation = "slide-down";};
};
settings = {
inactive-dim = 0.2;
focus-exclude = ["class_g ?= 'rofi'" "class_g ?= 'Steam'"];
rounded-corners-exclude = [
"! name~=''" # Qtile == empty wm_class..
"window_type = 'dock'"
"window_type = 'desktop'"
];
corner-radius = 10;
round-borders = 0;
round-borders-exclude = [
"! name~=''" # Qtile == empty wm_class..
];
blur = {
method = "dual_kawase";
strength = 10.0;
background = true;
background-frame = false;
background-fixed = false;
};
blur-background-exclude = ["window_type != 'dock'"];
daemon = false;
dbus = false;
mark-wmwin-focused = false;
mark-ovredir-focused = false;
detect-rounded-corners = true;
detect-client-opacity = true;
unredir-if-possible = false;
unredir-if-possible-exclude = [];
detect-transient = true;
detect-client-leader = true;
invert-color-include = [];
glx-no-stencil = true;
use-damage = false;
transparent-clipping = false;
};
};
systemd.user.services.setxkbmap = {
Unit = {
Description = "Set up keyboard in X";
@ -176,54 +39,4 @@
ExecStart = "/usr/bin/env load_xkb_map";
};
};
systemd.user.services.notifications-tray-icon = {
Unit = {
Description = "Notifications tray icon";
After = [ "graphical-session-pre.target" "tray.target" ];
PartOf = [ "graphical-session.target" ];
};
Install = { WantedBy = [ "graphical-session.target" ]; };
Service = {
ExecStart = "${pkgs.haskellPackages.notifications-tray-icon}/bin/notifications-tray-icon --github-token-pass dfinity-github-api-token";
Restart = "always";
RestartSec = 3;
};
};
systemd.user.services.shutter = {
Unit = {
Description = "Shutter";
After = [ "graphical-session-pre.target" "tray.target" ];
PartOf = [ "graphical-session.target" ];
};
Install = { WantedBy = [ "graphical-session.target" ]; };
Service = {
ExecStart = "${pkgs.shutter}/bin/shutter --min_at_startup";
Restart = "always";
RestartSec = 3;
};
};
systemd.user.services.discord = {
Unit = {
Description = "Discord";
After = [ "graphical-session-pre.target" "tray.target" ];
PartOf = [ "graphical-session.target" ];
};
Install = { WantedBy = [ "graphical-session.target" ]; };
Service = {
ExecStart = "${pkgs.discord}/opt/Discord/Discord --start-minimized";
Restart = "always";
RestartSec = 3;
};
};
home.stateVersion = "21.05";
}

View File

@ -0,0 +1,19 @@
{ config, ... }: {
services.git-sync = {
enable = true;
repositories = {
config = {
path = config.home.homeDirectory + "/config";
uri = "git@github.com:IvanMalison/config.git";
};
org = {
path = config.home.homeDirectory + "/org";
uri = "git@github.com:IvanMalison/org.git";
};
password-store = {
path = config.home.homeDirectory + "/.password-store";
uri = "git@github.com:IvanMalison/.password-store.git";
};
};
};
}

5
nixos/keybase.nix Normal file
View File

@ -0,0 +1,5 @@
{ forEachUser, ... }: {
home-manager.users = forEachUser {
services.kbfs.enable = true;
};
}

View File

@ -15,7 +15,9 @@
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.initrd.kernelModules = [ "amdgpu" ];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" "amdgpu" ];
boot.initrd.availableKernelModules = [
"nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" "amdgpu"
];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];

View File

@ -1,11 +1,12 @@
{ config, lib, pkgs, inputs, ... }:
{ config, lib, pkgs, inputs, forEachUser, ... }:
{
imports = [
../full.nix
../nixified.ai.nix
];
modules.nixified-ai.enable = true;
boot.loader.systemd-boot.configurationLimit = 5;
networking.hostName = "ryzen-shine";
@ -102,6 +103,9 @@
# services.xrdp.openFirewall = true;
system.stateVersion = "20.03";
home-manager.users = forEachUser {
home.stateVersion = "21.05";
};
users.extraUsers.dean.home = "/shared/dean";
}

View File

@ -19,8 +19,14 @@ let
cfg = lib.attrByPath (lib.splitString "." pathStr) { enable = false; defaulted = true; } config;
# Extract 'imports' from configAttrs, if it exists
importsAttr = if configAttrs ? imports then configAttrs.imports else [];
# Remove 'imports' from configAttrs
configAttrsWithoutImports = lib.attrsets.removeAttrs configAttrs ["imports"];
in
{
options = optionsSet;
config = lib.mkIf cfg.enable configAttrs;
config = lib.mkIf cfg.enable configAttrsWithoutImports;
imports = importsAttr;
}

View File

@ -1,4 +1,5 @@
{ inputs, config, ... }: {
{ inputs, config, specialArgs, ... }:
specialArgs.makeEnable config "modules.nixified-ai" false {
imports = [
inputs.nixified-ai.nixosModules.invokeai
];

View File

@ -1,4 +1,4 @@
{ pkgs, inputs, ... }:
{ pkgs, inputs, realUsers, forEachUser, ... }:
{
security.sudo.wheelNeedsPassword = false;
users.users = let
@ -67,5 +67,7 @@
};
};
nix.settings.trusted-users = [ "root" "imalison" "kat" "dean" "alex" ];
nix.settings.trusted-users = realUsers;
home-manager.users = forEachUser (import ./home-manager.nix);
}

View File

@ -1,5 +1,5 @@
{ config, pkgs, options, inputs, specialArgs, ... }:
specialArgs.makeEnable config "modules.xmonad" true {
{ config, pkgs, options, inputs, forEachUser, makeEnable, ... }:
makeEnable config "modules.xmonad" true {
nixpkgs.overlays = with inputs; [
xmonad.overlay
xmonad-contrib.overlay
@ -31,5 +31,153 @@ specialArgs.makeEnable config "modules.xmonad" true {
haskellPackages.dbus-hslogger
];
home-manager.users.imalison = (import ./home-manager.nix);
home-manager.users = forEachUser {
services.blueman-applet = {
enable = true;
};
services.taffybar = {
enable = true;
package = inputs.imalison-taffybar.defaultPackage."${pkgs.system}";
};
services.notify-osd = {
enable = true;
package = pkgs.notify-osd-customizable;
};
services.kdeconnect = {
enable = true;
indicator = true;
};
services.network-manager-applet.enable = true;
services.udiskie = {
enable = true;
tray = "always";
};
services.status-notifier-watcher.enable = true;
services.autorandr.enable = true;
services.random-background = {
enable = true;
display = "fill";
interval = "1h";
imageDirectory = "%h/Pictures/wallpaper/use";
};
services.xsettingsd.enable = true;
services.volnoti.enable = true;
services.pasystray.enable = true;
services.parcellite = {
enable = true;
package = pkgs.clipit;
};
services.picom = {
enable = true;
vSync = false;
backend = "glx";
extraArgs = ["--experimental-backends"];
settings = {
animations = true;
animation-window-mass = 1;
animation-dampening = 20;
animation-stiffness = 250;
animation-clamping = false;
animation-for-open-window = "zoom";
animation-for-unmap-window = "zoom";
animation-for-transient-window = "slide-down";
fade-in-step = 0.028;
fade-out-step = 0.028;
fading = true;
};
wintypes = {
dock = {animation = "slide-down";};
toolbar = {animation = "slide-down";};
};
settings = {
inactive-dim = 0.2;
focus-exclude = ["class_g ?= 'rofi'" "class_g ?= 'Steam'"];
rounded-corners-exclude = [
"! name~=''" # Qtile == empty wm_class..
"window_type = 'dock'"
"window_type = 'desktop'"
];
corner-radius = 10;
round-borders = 0;
round-borders-exclude = [
"! name~=''" # Qtile == empty wm_class..
];
blur = {
method = "dual_kawase";
strength = 10.0;
background = true;
background-frame = false;
background-fixed = false;
};
blur-background-exclude = ["window_type != 'dock'"];
daemon = false;
dbus = false;
mark-wmwin-focused = false;
mark-ovredir-focused = false;
detect-rounded-corners = true;
detect-client-opacity = true;
unredir-if-possible = false;
unredir-if-possible-exclude = [];
detect-transient = true;
detect-client-leader = true;
invert-color-include = [];
glx-no-stencil = true;
use-damage = false;
transparent-clipping = false;
};
};
systemd.user.services.notifications-tray-icon = {
Unit = {
Description = "Notifications tray icon";
After = [ "graphical-session-pre.target" "tray.target" ];
PartOf = [ "graphical-session.target" ];
};
Install = { WantedBy = [ "graphical-session.target" ]; };
Service = {
ExecStart = "${pkgs.haskellPackages.notifications-tray-icon}/bin/notifications-tray-icon --github-token-pass dfinity-github-api-token";
Restart = "always";
RestartSec = 3;
};
};
systemd.user.services.shutter = {
Unit = {
Description = "Shutter";
After = [ "graphical-session-pre.target" "tray.target" ];
PartOf = [ "graphical-session.target" ];
};
Install = { WantedBy = [ "graphical-session.target" ]; };
Service = {
ExecStart = "${pkgs.shutter}/bin/shutter --min_at_startup";
Restart = "always";
RestartSec = 3;
};
};
};
}