Compare commits

...

16 commits

Author SHA1 Message Date
f9f9abf279
feat: qt 2025-05-26 13:43:13 -07:00
0ba745d792
feat: add check recipes 2025-05-26 13:43:07 -07:00
ead6eb1832
feat: gtk 2025-05-26 13:37:06 -07:00
a813e5a010
style: move stylix.nix into shell/ 2025-05-26 13:30:59 -07:00
5ce5eb0a8f
feat: move misc.nix into default.nix's config = {} 2025-05-26 13:30:31 -07:00
6ea68a2b25
fix: force using unfree packages for whatsapp-emoji-font 2025-05-26 13:30:12 -07:00
106b0d752e
feat: wrap all config in config = {}
To make it easier to add other top level attrsets if needed
2025-05-26 13:29:52 -07:00
ccfb74fa5c
fix: allow unfree packages 2025-05-26 13:21:57 -07:00
540bd601e2
feat: home-manager stylix 2025-05-26 13:21:57 -07:00
6ab38a390f
feat: add default pinentry 2025-05-26 13:17:46 -07:00
181970f273
fix: imports 2025-05-26 13:16:54 -07:00
79d253f2d7
fix: use lib.mkMerge instead of //
// doesn't deep merge, so marleyos.openssh.enable didn't stay set to
true after the desktop profile was applied
2025-05-26 13:16:34 -07:00
2b98d371f1
fix: pass marleylib to home-manager 2025-05-26 13:15:20 -07:00
fc4764ef04
chore: remove unused nixGL 2025-05-26 11:30:09 -07:00
6be6e4db46
feat: xdg 2025-05-26 11:29:47 -07:00
93ba9bfdaa
style: reorganizing 2025-05-26 11:20:05 -07:00
47 changed files with 323 additions and 300 deletions

View file

@ -74,6 +74,14 @@ genFirefoxAddons:
secret name: secret name:
cd secrets && agenix --edit {{name}}.age --identity ~/.ssh/marley@nyx && cd - cd secrets && agenix --edit {{name}}.age --identity ~/.ssh/marley@nyx && cd -
[group('maintainence')]
check:
nix flake check
[group('maintainence')]
checkall:
nix flake check --all-systems
alias s := search alias s := search
search this: search this:
nh search {{this}} nh search {{this}}

View file

@ -1,4 +1,4 @@
let {marleylib, ...}: let
my = { my = {
name = "marley"; name = "marley";
fullName = "Marley Rae"; fullName = "Marley Rae";
@ -6,6 +6,7 @@ let
email = "marley@punkfairie.net"; email = "marley@punkfairie.net";
}; };
in { in {
config = {
marleycfg.my = my; marleycfg.my = my;
home-manager = { home-manager = {
@ -18,5 +19,7 @@ in {
}; };
sharedModules = [../home]; sharedModules = [../home];
extraSpecialArgs = {inherit marleylib;};
};
}; };
} }

View file

@ -50,6 +50,10 @@
}; };
}; };
nixpkgs.config = {
allowUnfree = true;
};
# More useful repl. # More useful repl.
environment.systemPackages = let environment.systemPackages = let
nrepl = nrepl =

View file

@ -1,4 +1,5 @@
{pkgs, ...}: { {pkgs, ...}: {
config = {
stylix = { stylix = {
enable = true; enable = true;
@ -18,4 +19,5 @@
}; };
}; };
}; };
};
} }

View file

@ -1,9 +0,0 @@
{
nix = {
settings = {
trusted-users = [
"@darwin"
];
};
};
}

View file

@ -3,8 +3,11 @@
inputs.agenix.darwinModules.default inputs.agenix.darwinModules.default
../base ../base
./base
./home.nix
./stylix.nix
./system
./programs ./programs
]; ];
} }

View file

@ -0,0 +1,6 @@
{
imports = [
./homebrew.nix
./nix.nix
];
}

View file

@ -0,0 +1,11 @@
{
config = {
nix = {
settings = {
trusted-users = [
"@darwin"
];
};
};
};
}

View file

@ -5,8 +5,11 @@
./options ./options
./home-manager.nix ./home-manager.nix
./profile.nix
./system
./shell
./programs ./programs
./profiles.nix
]; ];
} }

View file

@ -1,8 +1,10 @@
{ {
config = {
programs.home-manager.enable = true; programs.home-manager.enable = true;
home.language.base = "en_US.UTF-8"; home.language.base = "en_US.UTF-8";
# Autostart wanted systemd services on Linux. # Autostart wanted systemd services on Linux.
systemd.user.startServices = true; systemd.user.startServices = true;
};
} }

View file

@ -1,6 +1,7 @@
{osConfig, ...}: let {osConfig, ...}: let
cfg = osConfig.marleycfg; cfg = osConfig.marleycfg;
in { in {
config = {
marleycfg = { marleycfg = {
profiles = { profiles = {
inherit (cfg.profiles) desktop server; inherit (cfg.profiles) desktop server;
@ -10,4 +11,5 @@ in {
inherit (cfg.my) name fullName username email git; inherit (cfg.my) name fullName username email git;
}; };
}; };
};
} }

View file

@ -8,7 +8,7 @@
inherit (marleylib.module) enabled; inherit (marleylib.module) enabled;
in { in {
marleyos = marleyos = lib.mkMerge [
# Universal - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Universal - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{ {
programs = { programs = {
@ -18,9 +18,10 @@ in {
# #
# #
# Graphical Desktop - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Graphical Desktop - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// (lib.optionalAttrs cfg.desktop {}) (lib.optionalAttrs cfg.desktop {})
# #
# #
# Server - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Server - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// (lib.optionalAttrs cfg.server {}); (lib.optionalAttrs cfg.server {})
];
} }

View file

@ -1,17 +0,0 @@
{config, ...}: {
config.home = {
sessionPath = [
"${config.home.homeDirectory}/.local/bin"
];
sessionVariables = {
HACK = "${config.home.homeDirectory}/hackin";
};
shellAbbrs = {
c = "clear";
e = "${config.home.sessionVariables.EDITOR}";
v = "${config.home.sessionVariables.EDITOR}";
};
};
}

View file

@ -1,7 +1,7 @@
{ {
imports = [ imports = [
./home.nix
./nix.nix
./stylix.nix ./stylix.nix
./gtk.nix
./qt.nix
]; ];
} }

View file

@ -2,12 +2,8 @@
lib, lib,
config, config,
... ...
}: let }: {
cfg = config.marleyos.appearance.gtk; config = lib.mkIf config.marleycfg.profiles.desktop {
in {
options.marleyos.appearance.gtk.enable = lib.mkEnableOption "gtk";
config = lib.mkIf cfg.enable {
home.pointerCursor.gtk.enable = true; home.pointerCursor.gtk.enable = true;
gtk = { gtk = {

11
modules/home/shell/qt.nix Normal file
View file

@ -0,0 +1,11 @@
{
lib,
config,
...
}: {
config = lib.mkIf config.marleycfg.profiles.desktop {
qt = {
enable = true;
};
};
}

View file

@ -0,0 +1,21 @@
{
lib,
pkgs,
...
}: {
config = {
stylix = {
iconTheme = {
package = pkgs.kora-icon-theme;
dark = "kora";
light = "kora-light-panel";
};
fonts.sizes.terminal = lib.mkIf pkgs.stdenv.isDarwin 14;
};
home.packages = with pkgs; [
kora-icon-theme
];
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./session.nix
./xdg.nix
];
}

View file

@ -0,0 +1,34 @@
{
config,
pkgs,
...
}: let
inherit (config.marleycfg) profiles;
in {
config = {
home = {
sessionPath = [
"${config.home.homeDirectory}/.local/bin"
];
sessionVariables = {
HACK = "${config.home.homeDirectory}/hackin";
};
shellAbbrs = {
c = "clear";
e = "${config.home.sessionVariables.EDITOR}";
v = "${config.home.sessionVariables.EDITOR}";
};
packages = [
config.marleycfg.apps.pinentry
];
};
marleycfg.apps.pinentry =
if profiles.desktop
then pkgs.pinentry-gtk2
else pkgs.pinentry-curses;
};
}

View file

@ -1,42 +1,39 @@
{ {
config, config,
lib, lib,
system,
pkgs, pkgs,
... ...
}: let }: let
inherit (lib.snowfall.system) is-linux; inherit (config.marleycfg) profiles;
inherit (config.marleyos) isDesktop;
in { in {
config = { config = {
home.preferXdgDirectories = true; home.preferXdgDirectories = true;
xdg = let xdg = let
homeDir = config.home.homeDirectory; home = config.home.homeDirectory;
in in
lib.mkMerge [ lib.mkMerge [
{ {
enable = true; enable = true;
cacheHome = "${homeDir}/.cache"; cacheHome = "${home}/.cache";
configHome = "${homeDir}/.config"; configHome = "${home}/.config";
dataHome = "${homeDir}/.local/share"; dataHome = "${home}/.local/share";
stateHome = "${homeDir}/.local/state"; stateHome = "${home}/.local/state";
} }
(lib.mkIf (isDesktop && (is-linux system)) { (lib.mkIf (profiles.desktop && pkgs.stdenv.isLinux) {
userDirs = { userDirs = {
enable = true; enable = true;
createDirectories = true; createDirectories = true;
desktop = "${homeDir}/desktop"; desktop = "${home}/desktop";
documents = null; documents = null;
download = "${homeDir}/downloads"; download = "${home}/downloads";
music = null; music = null;
pictures = "${homeDir}/pictures"; pictures = "${home}/pictures";
templates = null; templates = null;
videos = "${homeDir}/videos"; videos = "${home}/videos";
}; };
portal = { portal = {
@ -50,7 +47,7 @@ in {
enable = true; enable = true;
associations.added = let associations.added = let
browser = "${lib.getName config.marleyos.apps.browser}"; browser = "${lib.getName config.marleycfg.apps.browser}";
in { in {
"application/json" = ["nvim.desktop"]; "application/json" = ["nvim.desktop"];
"application/pdf" = ["org.pwmt.zathura-pdf-mupdf.desktop"]; "application/pdf" = ["org.pwmt.zathura-pdf-mupdf.desktop"];

View file

@ -1,17 +0,0 @@
{
pkgs,
lib,
config,
...
}: {
boot = {
kernelPackages =
lib.mkIf (!config.marleycfg.profiles.server)
pkgs.linuxPackages_xanmod;
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
};
}

View file

@ -1,10 +0,0 @@
{pkgs, ...}: {
fonts = {
enableDefaultPackages = true;
packages = with pkgs; [
corefonts
noto-fonts
];
};
}

View file

@ -1,14 +0,0 @@
{
config,
inputs,
...
}: let
inherit (config.marleycfg.my) name;
in {
imports = [inputs.home-manager.nixosModules.home-manager];
config = {
home-manager.users."${name}" = {
home.homeDirectory = "/home/${name}";
};
};
}

View file

@ -1,15 +0,0 @@
{config, ...}: {
time.timeZone =
if config.marleycfg.profiles.server
then "UTC"
else "America/Los_Angeles";
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_MESSAGES = "en_US.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
};
}

View file

@ -1,16 +0,0 @@
{
lib,
config,
...
}: {
networking = {
networkmanager.enable = true;
firewall = {
enable = true;
allowedTCPPorts = [80 443];
};
wireless.enable = lib.mkIf config.marleycfg.profiles.server false;
};
}

View file

@ -1,9 +0,0 @@
{
nix = {
settings = {
trusted-users = [
"@wheel"
];
};
};
}

View file

@ -1,42 +0,0 @@
{
lib,
config,
...
}: let
my = {
name = "marley";
username = "punkfairie";
fullName = "Marley Rae";
email = "marley@punkfairie.net";
};
desktopPass = "$y$j9T$ztWf9WeUCENC2T12qS4mi1$51ihV/5cQ8mdJJrNe7MMguk4hPB61S5xHawsfi.1hL3";
serverPass = "$y$j9T$8hA7OWZsdQMHqYIy8LkYQ1$hFeP2ak3QA4FtoIYIwqPg10//ZOSZrAw1PzJj0PuGSA";
in {
marleycfg.my = {
inherit (my) name username fullName email;
};
users = {
mutableUsers = false;
groups = {
"compat" = {
gid = 1000;
};
};
users."${my.name}" = {
isNormalUser = true;
description = my.fullName;
extraGroups =
["wheel" "compat"]
++ (lib.optional config.networking.networkmanager.enable "networkmanager")
++ (lib.optional config.virtualisation.docker.enable "docker");
hashedPassword =
if config.marleycfg.profiles.server
then serverPass
else desktopPass;
};
};
}

View file

@ -4,10 +4,12 @@
../base ../base
./base
./hardware ./hardware
./system
./shell ./shell
./users.nix
./programs ./programs
./services ./services

View file

@ -3,7 +3,9 @@
./audio.nix ./audio.nix
./mounts ./mounts
./nvidia.nix ./nvidia.nix
./misc.nix # try to use this as little as possible
]; ];
config = {
services.printing.enable = true;
};
} }

View file

@ -1,3 +0,0 @@
{
services.printing.enable = true;
}

View file

@ -1,7 +1,9 @@
{ {
config = {
boot.supportedFilesystems = { boot.supportedFilesystems = {
ntfs = true; ntfs = true;
}; };
services.udisks2.enable = true; services.udisks2.enable = true;
};
} }

View file

@ -8,7 +8,7 @@
inherit (marleylib.module) enabled; inherit (marleylib.module) enabled;
in { in {
marleyos = marleyos = lib.mkMerge [
# Universal - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Universal - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{ {
programs = { programs = {
@ -24,7 +24,7 @@ in {
# #
# #
# Graphical Desktop - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Graphical Desktop - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// (lib.optionalAttrs cfg.desktop { (lib.optionalAttrs cfg.desktop {
mounts.babeshare = enabled; mounts.babeshare = enabled;
shell = { shell = {
@ -40,9 +40,10 @@ in {
# #
# #
# Server - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Server - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// (lib.optionalAttrs cfg.server { (lib.optionalAttrs cfg.server {
services = { services = {
prometheus = enabled; prometheus = enabled;
}; };
}); })
];
} }

View file

@ -1,5 +1,8 @@
{ {
imports = [ imports = [
./stylix.nix
./fonts.nix
./hyprlock.nix ./hyprlock.nix
./ly.nix ./ly.nix
./niri.nix ./niri.nix

View file

@ -0,0 +1,12 @@
{pkgs, ...}: {
config = {
fonts = {
enableDefaultPackages = true;
packages = with pkgs; [
corefonts
noto-fonts
];
};
};
}

View file

@ -1,11 +1,15 @@
{ {
inputs, inputs,
lib,
pkgs, pkgs,
... ...
}: { }: {
imports = [inputs.stylix.nixosModules.stylix]; imports = [inputs.stylix.nixosModules.stylix];
config = { config = {
# whatsapp-emoji-font is unfree.
nixpkgs.config.allowUnfree = lib.mkForce true;
stylix = { stylix = {
enable = true; enable = true;

View file

@ -0,0 +1,19 @@
{
pkgs,
lib,
config,
...
}: {
config = {
boot = {
kernelPackages =
lib.mkIf (!config.marleycfg.profiles.server)
pkgs.linuxPackages_xanmod;
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
};
};
}

View file

@ -1,12 +1,8 @@
{ {
imports = [ imports = [
./boot.nix ./boot.nix
./fonts.nix
./home.nix
./i18n.nix ./i18n.nix
./networking.nix ./networking.nix
./nix.nix ./nix.nix
./stylix.nix
./users.nix
]; ];
} }

View file

@ -0,0 +1,17 @@
{config, ...}: {
config = {
time.timeZone =
if config.marleycfg.profiles.server
then "UTC"
else "America/Los_Angeles";
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_MESSAGES = "en_US.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
};
};
}

View file

@ -0,0 +1,18 @@
{
lib,
config,
...
}: {
config = {
networking = {
networkmanager.enable = true;
firewall = {
enable = true;
allowedTCPPorts = [80 443];
};
wireless.enable = lib.mkIf config.marleycfg.profiles.server false;
};
};
}

View file

@ -0,0 +1,11 @@
{
config = {
nix = {
settings = {
trusted-users = [
"@wheel"
];
};
};
};
}

51
modules/nixos/users.nix Normal file
View file

@ -0,0 +1,51 @@
{
inputs,
lib,
config,
...
}: let
my = {
name = "marley";
username = "punkfairie";
fullName = "Marley Rae";
email = "marley@punkfairie.net";
};
desktopPass = "$y$j9T$ztWf9WeUCENC2T12qS4mi1$51ihV/5cQ8mdJJrNe7MMguk4hPB61S5xHawsfi.1hL3";
serverPass = "$y$j9T$8hA7OWZsdQMHqYIy8LkYQ1$hFeP2ak3QA4FtoIYIwqPg10//ZOSZrAw1PzJj0PuGSA";
in {
imports = [inputs.home-manager.nixosModules.home-manager];
config = {
marleycfg.my = {
inherit (my) name username fullName email;
};
users = {
mutableUsers = false;
groups = {
"compat" = {
gid = 1000;
};
};
users."${my.name}" = {
isNormalUser = true;
description = my.fullName;
extraGroups =
["wheel" "compat"]
++ (lib.optional config.networking.networkmanager.enable "networkmanager")
++ (lib.optional config.virtualisation.docker.enable "docker");
hashedPassword =
if config.marleycfg.profiles.server
then serverPass
else desktopPass;
};
};
home-manager.users."${my.name}" = {
home.homeDirectory = "/home/${my.name}";
};
};
}

View file

@ -1,40 +0,0 @@
{
lib,
config,
pkgs,
system,
inputs,
...
}: let
inherit (lib.snowfall.system) is-darwin;
cfg = config.marleyos.appearance.base;
inherit (config.marleyos) isDesktop;
in {
options.marleyos.appearance.base.enable = lib.mkEnableOption "base";
config = lib.mkIf cfg.enable {
marleyos = {
apps = {
pinentry =
if isDesktop
then pkgs.pinentry-gtk2
else pkgs.pinentry-curses;
};
};
stylix = {
iconTheme = {
package = pkgs.kora-icon-theme;
dark = "kora";
light = "kora-light-panel";
};
fonts.sizes.terminal = lib.mkIf (is-darwin system) 14;
};
home.packages = with pkgs; [
kora-icon-theme
];
};
}

View file

@ -1,16 +0,0 @@
{
lib,
config,
inputs,
...
}: let
cfg = config.marleyos.appearance.qt;
in {
options.marleyos.appearance.qt.enable = lib.mkEnableOption "qt";
config = lib.mkIf cfg.enable {
qt = {
enable = true;
};
};
}

View file

@ -1,17 +0,0 @@
{
lib,
config,
inputs,
...
}: let
cfg = config.marleyos.nixGL;
in {
options.marleyos.nixGL.enable = lib.mkEnableOption "nixGL";
config = lib.mkIf cfg.enable {
nixGL = {
inherit (inputs.nixgl) packages;
defaultWrapper = "nvidia";
};
};
}