authorgravatar for git@paperclover.netclover caruso <git@paperclover.net> 2025-05-06 17:20:37-07:00
committergravatar for git@paperclover.netclover caruso <git@paperclover.net> 2025-05-06 23:31:44-07:00
log8bd9e070d076cb96c0c404b4ec3371f2696f7089
treec0d47a6364bda49bbb8c95ded34a310935012c37
parentc0cfb69f27c9caf3e3dd21e3a0d530fa27898f95

fix natalie config so it builds successfully


21 files changed, 210 insertions(+), 152 deletions(-)

flake.nix+13-22
......@@ -2,7 +2,6 @@
22 description = "New Modular flake!";
33 inputs = {
44 nixpkgs.url = "nixpkgs/nixos-unstable";
5 # nixpkgs.url = "github:NixOS/nixpkgs/master";
65 nixpkgs-stable.url = "nixpkgs/nixos-23.11";
76
87 home-manager.url = "github:nix-community/home-manager/master";
......@@ -77,35 +76,19 @@
7776 )
7877 ];
7978
80 # ----- USER SETTINGS ----- #
81 users.nmarks = rec {
82 #enable if you want to use a tiling wm on macos
83 darwinTiling = true;
84
85 username = "nmarks"; # username
86 name = "Natalie"; # name/identifier
87 email = "nmarks413@gmail.com"; # email (used for certain configurations)
88 dotfilesDir = "~/.dotfiles"; # absolute path of the local repo
89 theme = "catppuccin-mocha"; #name of theme that stylix will use
90 browser = "firefox"; # Default browser; must select one from ./user/app/browser/
91 term = "ghostty"; # Default terminal command;
92 font = "iosevka"; # Selected font
93 editor = "neovim"; # Default editor;
94 spawnEditor = "exec" + term + " -e " + editor;
95 timeZone = "America/Los_Angeles";
96 sexuality = "bisexual";
97 };
9879 mkSystem = import ./lib/mkSystem.nix {
9980 inherit overlays nixpkgs inputs;
10081 };
101 in {
82 in rec {
83 # "nix run .#darwin-rebuild"
10284 packages.aarch64-darwin.darwin-rebuild = darwin.packages.aarch64-darwin.darwin-rebuild;
85 # "nix fmt ."
10386 formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
10487 formatter.aarch64-darwin = nixpkgs.legacyPackages.aarch64-darwin.alejandra;
10588
10689 # natalie's desktop computer
10790 nixosConfigurations.nixos = mkSystem "nixos" {
108 user = "nmarks";
91 user = "natalie";
10992 host = "desktop";
11093 system = "x86_64-linux";
11194 extraModules = [
......@@ -114,7 +97,7 @@
11497 };
11598 # natalie's laptop
11699 darwinConfigurations."Natalies-MacBook-Air" = mkSystem "Natalies-MacBook-Air" {
117 user = "nmarks";
100 user = "natalie";
118101 host = "laptop";
119102 system = "aarch64-darwin";
120103 };
......@@ -131,5 +114,13 @@
131114 host = "paperback";
132115 system = "aarch64-darwin";
133116 };
117
118 # generate checks for "nix flake check --all-systems --no-build"
119 checks.aarch64-darwin = builtins.listToAttrs (builtins.map (name: let
120 d = darwinConfigurations.${name}.system;
121 in {
122 name = "darwinConfiguration-" + d.name;
123 value = d;
124 }) (builtins.attrNames darwinConfigurations));
134125 };
135126}
lib/mkSystem.nix+17-16
......@@ -44,24 +44,25 @@
4444 currentSystem = system;
4545 # Details about the host machine
4646 host = {
47 inherit darwin;
47 inherit darwin name;
4848 };
4949 user = ({
50 # This acts as formal documentation for what is allowed in user.nix
51 username, # unix username
52 name, # your display name
53 email, # for identity in programs such as git
54 dotfilesDir, # location to `../.`
55 timeZone ? "America/Los_Angeles",
56
57 # Stylix/Theming
58 theme ? null, # theme name for stylix
59 sexuality ? null, # pride flag for hyfetch
60
61 term, # preferred $TERM
62 editor, # preferred $EDITOR
63 browser ? null, # preferred $BROWSER
64 }@user: user) userConfig;
50 # This acts as formal documentation for what is allowed in user.nix
51 username, # unix username
52 name, # your display name
53 email, # for identity in programs such as git
54 dotfilesDir, # location to `../.`
55 timeZone ? "America/Los_Angeles",
56 # Stylix/Theming
57 theme ? null, # theme name for stylix
58 sexuality ? null, # pride flag for hyfetch
59 font ? null, # font to use
60 term, # preferred $TERM
61 editor, # preferred $EDITOR
62 browser ? null, # preferred $BROWSER
63 } @ user:
64 user)
65 userConfig;
6566 };
6667 systemSettings = rec {
6768 inherit darwin;
modules/home-manager.nix+2-1
......@@ -69,7 +69,8 @@ in {
6969 }
7070 ];
7171 shellAliases =
72 { } // lib.optionalAttrs (!host.darwin) {
72 {}
73 // lib.optionalAttrs (!host.darwin) {
7374 reboot-windows = "sudo efibootmgr --bootnext 0000; sudo reboot -h now";
7475 };
7576 shellInit = ''
modules/macos/default.nix+7
......@@ -8,6 +8,13 @@
88 ./mac-app-store.nix
99 ./system.nix
1010 ./icons.nix
11 ./tiling
1112 # sort-lines: end
1213 ];
14 # make 'shared.linux' not an error to define.
15 options.shared.linux = lib.mkOption {
16 type = lib.types.anything;
17 default = {};
18 description = "no-op on darwin";
19 };
1320}
modules/macos/system.nix+5-3
......@@ -3,7 +3,9 @@
33 pkgs,
44 lib,
55 ...
6}: {
6}: let
7 tiling = config.shared.darwin.tiling.enable;
8in {
79 # Use touchid or watch to activate sudo
810 security.pam.services.sudo_local = {
911 enable = true;
......@@ -51,8 +53,8 @@
5153 NSDocumentSaveNewDocumentsToCloud = false;
5254 AppleICUForce24HourTime = true;
5355
54 #Autohide menu bar
55 #_HIHideMenuBar = config.shared.darwin.tiling;
56 # Autohide menu bar for tiling window manager
57 _HIHideMenuBar = tiling;
5658 };
5759 # minimal dock
5860 dock = {
modules/macos/tiling/aerospace.nix+2-2
......@@ -1,6 +1,6 @@
1{pkgs, ...}: {
1{config,pkgs, ...}: {
22 services.aerospace = {
3 enable = true;
3 enable = config.shared.darwin.tiling.enable;
44 settings = {
55 # Normalizations. See: https://nikitabobko.github.io/AeroSpace/guide#normalization
66 enable-normalization-flatten-containers = true;
modules/macos/tiling/default.nix+15-1
......@@ -1,2 +1,16 @@
1{pkgs, ...}: {
1{ lib, ... }: let
2 inherit (lib) types;
3in {
4 imports = [
5 ./sketchybar.nix
6 ./aerospace.nix
7 ];
8 options = {
9 shared.darwin.tiling.enable = lib.mkOption {
10 type = types.bool;
11 default = false;
12 example = true;
13 description = "Enable tiling window management.";
14 };
15 };
216}
modules/macos/tiling/sketchybar.nix+2-2
......@@ -1,6 +1,6 @@
1{pkgs, ...}: {
1{config,pkgs, ...}: {
22 services.sketchybar = {
3 enable = true;
3 enable = config.shared.darwin.tiling.enable;
44 config = ''
55 # This is a demo config to showcase some of the most important commands.
66 # It is meant to be changed and configured, as it is intentionally kept sparse.
modules/nixos/default.nix+7-1
......@@ -1,8 +1,14 @@
1{pkgs, ...}: {
1{ lib, pkgs, ... }: {
22 imports = [
33 ./boot.nix
44 ./ld.nix
55 ./nvidia.nix
66 ./services.nix
77 ];
8 # make 'shared.darwin' not an error to define.
9 options.shared.darwin = lib.mkOption {
10 type = lib.types.anything;
11 default = {};
12 description = "no-op on linux";
13 };
814}
modules/shared/user-system-settings.nix+14-7
......@@ -1,14 +1,21 @@
11# applies user settings for the system
2{ pkgs, user, lib, ... }: {
2{
3 pkgs,
4 user,
5 lib,
6 ...
7}: {
38 # Set your time zone.
49 time.timeZone = user.timeZone;
510
6 home-manager.users.${user.username}.home.sessionVariables = {
7 EDITOR = user.editor;
8 TERMINAL = user.term;
9 } // lib.optionalAttrs (user ? "browser") {
10 BROWSER = user.browser;
11 };
11 home-manager.users.${user.username}.home.sessionVariables =
12 {
13 EDITOR = user.editor;
14 TERMINAL = user.term;
15 }
16 // lib.optionalAttrs (user ? "browser") {
17 BROWSER = user.browser;
18 };
1219
1320 stylix = {
1421 enable = false;
readme.md+27-2
......@@ -1,10 +1,35 @@
11# nix config
22
3meow.
3this setup allows natalie and chloe to share common configuration between their machines, but also share useful modules between each other.
4
5```
6lib/ # reusable functions
7modules/ # reusable modules
8 +-- macos/ # nix-darwin configurations
9 +-- nixos/ # linux configurations
10 +-- nixvim/ # neovim configurations
11 +-- shared/ # shared between nixos-rebuild & nixos-rebuild
12 +-- home-manager.nix # home program presets
13users/
14 +-- chloe/
15 | +-- user.nix # info about her
16 | +-- configuration.nix # for all hosts
17 | +-- home.nix # for all hosts
18 | +-- sandwich/
19 | | +-- configuration.nix # per host
20 | | +-- home.nix
21 | +-- paperback/
22 | ...
23 +-- natalie/
24 +-- user.nix # info about her
25 ...
26```
27
28A new machine can be added by adding a new definition in `flake.nix`. Note that the user and host `configuration.nix` and `home.nix` files are
429
530## macOS installation instructions
631
7Install Nix using the upstream nix (Pick "no" then "yes):
32Install Nix using the upstream Nix (Pick "no" then "yes):
833
934```
1035curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | \
users/chloe/configuration.nix+5-5
......@@ -1,18 +1,18 @@
11# Configuration applied to all of chloe's machines
2{
3 pkgs,
4 userSettings,
5 ...
6}: {
2{ pkgs, ... }: {
3 # packages for all machines
74 environment.systemPackages = with pkgs; [
85 neovim
96 ];
7 # configuration for shared modules.
8 # all custom options in 'shared' for clarity.
109 shared.darwin = {
1110 macAppStoreApps = [
1211 "adguard"
1312 "magnet"
1413 ];
1514 };
15 # system preferences
1616 system.defaults = {
1717 NSGlobalDomain = {
1818 KeyRepeat = 1;
users/chloe/user.nix+1-1
......@@ -14,5 +14,5 @@
1414
1515 # Default terminal command. NOTE: ghostty is not installed for you
1616 term = "ghostty"; # preferred $TERMINAL
17 editor = "nvim"; # preferred $EDITOR
17 editor = "nvim"; # preferred $EDITOR
1818}
users/natalie/configuration.nix+17-1
......@@ -1 +1,17 @@
1services.tailscale.enable = true;
1# Applied to all systems
2{pkgs, ...}: {
3 services.tailscale.enable = true;
4 fonts.packages = with pkgs; [
5 nerd-fonts.fira-code
6 nerd-fonts.iosevka
7 iosevka
8 nerd-fonts.symbols-only
9 nerd-fonts.iosevka
10 ];
11
12 # configuration for shared modules.
13 # all custom options in 'shared' for clarity.
14 shared.darwin = {
15 tiling.enable = true; # use tiling window manager
16 };
17}
users/natalie/desktop/configuration.nix+7-7
......@@ -1,7 +1,7 @@
11{
22 pkgs,
3 userSettings,
4 systemSettings,
3 user,
4 host,
55 ...
66}: {
77 imports = [
......@@ -16,7 +16,7 @@
1616 enable = true;
1717 # Certain features, including CLI integration and system authentication support,
1818 # require enabling PolKit integration on some desktop environments (e.g. Plasma).
19 polkitPolicyOwners = [userSettings.username];
19 polkitPolicyOwners = [user.username];
2020 };
2121
2222 noisetorch.enable = true;
......@@ -75,7 +75,7 @@
7575 libvirtd.enable = true;
7676 };
7777
78 nix.settings.trusted-users = ["root" userSettings.username];
78 nix.settings.trusted-users = ["root" user.username];
7979 systemd = {
8080 targets = {
8181 sleep.enable = false;
......@@ -129,10 +129,10 @@
129129
130130 # Define a user account. Don't forget to set a password with ‘passwd’.
131131 # users.defaultUserShell = pkgs.fish;
132 users.users.${userSettings.username} = {
132 users.users.${user.username} = {
133133 shell = pkgs.fish;
134134 isNormalUser = true;
135 description = "Natalie Marks";
135 description = user.name;
136136 extraGroups = ["networkmanager" "wheel" "docker"];
137137 # openssh.authorizedKeys.keyFiles = ["~/.ssh/id_ed25519.pub"];
138138 packages = with pkgs; [
......@@ -153,7 +153,7 @@
153153 };
154154
155155 networking = {
156 hostName = systemSettings.host; # Define your hostname.
156 hostName = host.name; # Define your hostname.
157157 # wireless.enable = true; # Enables wireless support via wpa_supplicant.
158158 networkmanager.enable = true;
159159 firewall = {
users/natalie/desktop/home.nix+39-49
......@@ -6,9 +6,7 @@
66 userSettings,
77 systemSettings,
88 ...
9}: let
10 shared-programs = import ../../modules/shared/homeManagerPrograms.nix {inherit inputs config pkgs lib userSettings systemSettings;};
11in {
9}: {
1210 imports = [
1311 inputs.nixvim.homeManagerModules.nixvim
1412 #set up nixvim
......@@ -17,56 +15,48 @@ in {
1715 home = {
1816 stateVersion = "23.05"; # Please read the comment before changing.
1917
20 packages = with pkgs; let
21 shared-packages = import ../../modules/shared/packages.nix {inherit pkgs systemSettings;};
22 in
23 shared-packages
24 ++ [
25 #building macos apps hard :(
26 ghostty
27 stremio
28 julia
29 qbittorrent
18 packages = with pkgs; [
19 #building macos apps hard :(
20 ghostty
21 stremio
22 julia
23 qbittorrent
3024
31 #gaming
32 bottles
33 lutris
34 mangohud
35 dxvk_2
36 steam-run
37 vulkan-tools
38 path-of-building
39 wineWowPackages.stable
40 winetricks
41 (prismlauncher.override {gamemodeSupport = true;})
25 #gaming
26 bottles
27 lutris
28 mangohud
29 dxvk_2
30 steam-run
31 vulkan-tools
32 path-of-building
33 wineWowPackages.stable
34 winetricks
35 (prismlauncher.override {gamemodeSupport = true;})
4236
43 #window manager stuff
44 wofi
45 xorg.xauth
46 #linux tools
47 legcord
48 pavucontrol
49 ethtool
50 grub2
51 efibootmgr
52 distrobox
53 xdg-desktop-portal-gtk
54 xclip
55 kdePackages.dolphin
56 #broken on macos
57 calibre
58 mpv
59 wireguard-tools
60 signal-desktop
61 ]
62 ++ [
63 inputs.zls.packages.x86_64-linux.zls
64 rust-bin.stable.latest.default
65 ];
37 #window manager stuff
38 wofi
39 xorg.xauth
40 #linux tools
41 legcord
42 pavucontrol
43 ethtool
44 grub2
45 efibootmgr
46 distrobox
47 xdg-desktop-portal-gtk
48 xclip
49 kdePackages.dolphin
50 #broken on macos
51 calibre
52 mpv
53 wireguard-tools
54 signal-desktop
55 inputs.zls.packages.x86_64-linux.zls
56 rust-bin.stable.latest.default
57 ];
6658 # programs.mangohud.enable = true;
6759 };
6860
69 programs = shared-programs;
70
7161 # xdg.mimeApps.defaultApplications."inode/directory" = "dolphin.desktop";
7262}
users/natalie/home.nix+11-14
......@@ -1,19 +1,16 @@
11{
22 pkgs,
33 lib,
4}: {
5 # sort-lines:start
6 atuin.enable = true;
7 bat.enable = true;
8 hyfetch.enable = true;
9 direnv.enable = true;
10 # sort-lines:end
4 ...
5} @ args: {
6 programs = {
7 # sort-lines:start
8 atuin.enable = true;
9 bat.enable = true;
10 hyfetch.enable = true;
11 direnv.enable = true;
12 # sort-lines:end
13 };
1114
12 fonts.packages = with pkgs; [
13 nerd-fonts.fira-code
14 nerd-fonts.iosevka
15 iosevka
16 nerd-fonts.symbols-only
17 nerd-fonts.iosevka
18 ];
15 home.packages = import ./packages.nix args;
1916}
users/natalie/laptop/configuration.nix+1-5
......@@ -1,8 +1,4 @@
1{
2 pkgs,
3 userSettings,
4 ...
5}: {
1{pkgs, ...}: {
62 environment.systemPackages = with pkgs; [
73 neovim
84 pinentry_mac
users/natalie/laptop/home.nix+3-8
......@@ -3,8 +3,8 @@
33 config,
44 pkgs,
55 lib,
6 userSettings,
7 systemSettings,
6 user,
7 host,
88 ...
99} @ args: {
1010 imports = [
......@@ -12,14 +12,9 @@
1212 #set up nixvim
1313 # ../../modules/nixvim
1414 ];
15 programs = import ./home-programs.nix args;
16
1715 home = {
18 inherit (userSettings) username;
19 # shell = pkgs.fish;
2016 stateVersion = "23.05"; # Please read the comment before changing.
21
22 packages = pkgs.callPackage ../../modules/shared/packages.nix {inherit systemSettings;};
17 # shell = pkgs.fish;
2318
2419 sessionPath = [
2520 "$HOME/.emacs.d/bin"
users/natalie/packages.nix+2-5
......@@ -1,8 +1,5 @@
1{
2 pkgs,
3 systemSettings,
4 ...
5}:
1# Packages installed with home-manager
2{pkgs, ...}:
63with pkgs; [
74 #general development
85 just
users/natalie/user.nix created+13
......@@ -0,0 +1,13 @@
1rec {
2 username = "nmarks"; # username
3 name = "Natalie"; # name/identifier
4 email = "nmarks413@gmail.com"; # email (used for certain configurations)
5 dotfilesDir = "~/.dotfiles"; # absolute path of the local repo
6 theme = "catppuccin-mocha"; #name of theme that stylix will use
7 browser = "firefox"; # Default browser; must select one from ./user/app/browser/
8 term = "ghostty"; # Default terminal command;
9 font = "iosevka"; # Selected font
10 editor = "neovim"; # Default editor;
11 timeZone = "America/Los_Angeles";
12 sexuality = "bisexual";
13}