authorgravatar for git@paperclover.netclover caruso <git@paperclover.net> 2025-05-05 23:56:54-07:00
committergravatar for git@paperclover.netclover caruso <git@paperclover.net> 2025-05-05 23:56:54-07:00
logc0cfb69f27c9caf3e3dd21e3a0d530fa27898f95
tree78d5b8cada8d0a213d7ce6cecda3887d24e74fdd
parent24d8eeb413b682d7ce51303b789f7c229ae2d9b6

write out chloe config, modularize stuff more


28 files changed, 727 insertions(+), 609 deletions(-)

.gitignore+2
...@@ -1 +1,3 @@...@@ -1 +1,3 @@
1flake.lock1flake.lock
2result
3result-*
flake.nix+12-26
...@@ -95,32 +95,18 @@...@@ -95,32 +95,18 @@
95 timeZone = "America/Los_Angeles";95 timeZone = "America/Los_Angeles";
96 sexuality = "bisexual";96 sexuality = "bisexual";
97 };97 };
98 users.paper_clover = rec {
99 #enable if you want to use a tiling wm on macos
100 darwinTiling = true;
101
102 username = "clo"; # username
103 name = "chloe caruso"; # name/identifier
104 email = "account@paperclover.net"; # email (used for certain configurations)
105 dotfilesDir = "~/config"; # absolute path of the local repo
106 theme = "catppuccin-mocha"; #name of theme that stylix will use
107 browser = "firefox"; # Default browser; must select one from ./user/app/browser/
108 term = "ghostty"; # Default terminal command;
109 font = "iosevka"; # Selected font
110 editor = "neovim"; # Default editor;
111 spawnEditor = "exec" + term + " -e " + editor;
112 timeZone = "America/Los_Angeles";
113 sexuality = "lesbian";
114 };
115
116 mkSystem = import ./lib/mkSystem.nix {98 mkSystem = import ./lib/mkSystem.nix {
117 inherit overlays nixpkgs inputs;99 inherit overlays nixpkgs inputs;
118 };100 };
119 in {101 in {
102 packages.aarch64-darwin.darwin-rebuild = darwin.packages.aarch64-darwin.darwin-rebuild;
103 formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
104 formatter.aarch64-darwin = nixpkgs.legacyPackages.aarch64-darwin.alejandra;
105
120 # natalie's desktop computer106 # natalie's desktop computer
121 nixosConfigurations.nixos = mkSystem "nixos" {107 nixosConfigurations.nixos = mkSystem "nixos" {
122 userSettings = users.nmarks;108 user = "nmarks";
123 configDir = ./hosts/natalie/desktop;109 host = "desktop";
124 system = "x86_64-linux";110 system = "x86_64-linux";
125 extraModules = [111 extraModules = [
126 nixos-cosmic.nixosModules.default112 nixos-cosmic.nixosModules.default
...@@ -128,21 +114,21 @@...@@ -128,21 +114,21 @@
128 };114 };
129 # natalie's laptop115 # natalie's laptop
130 darwinConfigurations."Natalies-MacBook-Air" = mkSystem "Natalies-MacBook-Air" {116 darwinConfigurations."Natalies-MacBook-Air" = mkSystem "Natalies-MacBook-Air" {
131 userSettings = users.nmarks;117 user = "nmarks";
132 configDir = ./hosts/natalie/laptop;118 host = "laptop";
133 system = "aarch64-darwin";119 system = "aarch64-darwin";
134 };120 };
135121
136 # chloe's mac studio "sandwich"122 # chloe's mac studio "sandwich"
137 darwinConfigurations.sandwich = mkSystem "sandwich" {123 darwinConfigurations.sandwich = mkSystem "sandwich" {
138 userSettings = users.paper_clover;124 user = "chloe";
139 configDir = ./hosts/chloe;125 host = "sandwich";
140 system = "aarch64-darwin";126 system = "aarch64-darwin";
141 };127 };
142 # chloe's macbook air "paperback"128 # chloe's macbook air "paperback"
143 darwinConfigurations.paperback = mkSystem "paperback" {129 darwinConfigurations.paperback = mkSystem "paperback" {
144 userSettings = users.paper_clover;130 user = "chloe";
145 configDir = ./hosts/chloe;131 host = "paperback";
146 system = "aarch64-darwin";132 system = "aarch64-darwin";
147 };133 };
148 };134 };
glance.yml deleted-108
...@@ -1,108 +0,0 @@
1pages:
2 - name: Home
3 # Optionally, if you only have a single page you can hide the desktop navigation for a cleaner look
4 # hide-desktop-navigation: true
5 columns:
6 - size: small
7 widgets:
8 - type: calendar
9 first-day-of-week: monday
10
11 - type: rss
12 limit: 10
13 collapse-after: 3
14 cache: 12h
15 feeds:
16 - url: https://selfh.st/rss/
17 title: selfh.st
18 limit: 4
19 - url: https://ciechanow.ski/atom.xml
20 - url: https://www.joshwcomeau.com/rss.xml
21 title: Josh Comeau
22 - url: https://samwho.dev/rss.xml
23 - url: https://ishadeed.com/feed.xml
24 title: Ahmad Shadeed
25
26 - type: twitch-channels
27 channels:
28 - theprimeagen
29 - j_blow
30 - piratesoftware
31 - cohhcarnage
32 - christitustech
33 - EJ_SA
34
35 - size: full
36 widgets:
37 - type: group
38 widgets:
39 - type: hacker-news
40 - type: lobsters
41
42 - type: videos
43 channels:
44 - UCXuqSBlHAE6Xw-yeJA0Tunw # Linus Tech Tips
45 - UCR-DXc1voovS8nhAvccRZhg # Jeff Geerling
46 - UCsBjURrPoezykLs9EqgamOA # Fireship
47 - UCBJycsmduvYEL83R_U4JriQ # Marques Brownlee
48 - UCHnyfMqiRRG1u-2MsSQLbXA # Veritasium
49
50 - type: group
51 widgets:
52 - type: reddit
53 subreddit: technology
54 show-thumbnails: true
55 - type: reddit
56 subreddit: selfhosted
57 show-thumbnails: true
58
59 - size: small
60 widgets:
61 - type: weather
62 location: London, United Kingdom
63 units: metric # alternatively "imperial"
64 hour-format: 12h # alternatively "24h"
65 # Optionally hide the location from being displayed in the widget
66 # hide-location: true
67
68 - type: markets
69 # The link to go to when clicking on the symbol in the UI,
70 # {SYMBOL} will be substituded with the symbol for each market
71 symbol-link-template: https://www.tradingview.com/symbols/{SYMBOL}/news
72 markets:
73 - symbol: SPY
74 name: S&P 500
75 - symbol: BTC-USD
76 name: Bitcoin
77 - symbol: NVDA
78 name: NVIDIA
79 - symbol: AAPL
80 name: Apple
81 - symbol: MSFT
82 name: Microsoft
83
84 - type: releases
85 cache: 1d
86 # Without authentication the Github API allows for up to 60 requests per hour. You can create a
87 # read-only token from your Github account settings and use it here to increase the limit.
88 # token: ...
89 repositories:
90 - glanceapp/glance
91 - go-gitea/gitea
92 - immich-app/immich
93 - syncthing/syncthing
94
95 # Add more pages here:
96 # - name: Your page name
97 # columns:
98 # - size: small
99 # widgets:
100 # # Add widgets here
101
102 # - size: full
103 # widgets:
104 # # Add widgets here
105
106 # - size: small
107 # widgets:
108 # # Add widgets here
lib/mkSystem.nix+135-99
...@@ -5,111 +5,147 @@...@@ -5,111 +5,147 @@
5 overlays,5 overlays,
6 inputs,6 inputs,
7}: name: {7}: name: {
8 userSettings,8 user, # ./users/{name}
9 system,9 host ? null, # ./users/{name}/{host} (optional)
10 configDir, # base host config10 system, # arch-os
11 extraModules ? [],11 extraModules ? [],
12}: let12}: let
13 inherit (builtins) pathExists;
13 darwin = nixpkgs.lib.strings.hasSuffix "-darwin" system;14 darwin = nixpkgs.lib.strings.hasSuffix "-darwin" system;
1415 getInputModule = a: b:
15 nixindex =16 inputs.${
16 if darwin17 a
17 then inputs.nix-index-database.darwinModules.nix-index18 }.${
18 else inputs.nix-index-database.nixosModules.nix-index;
19
20 stylix =
21 if darwin
22 then inputs.stylix.darwinModules.stylix
23 else inputs.stylix.nixosModules.stylix;
24
25 systemModuleDir =
26 if darwin
27 then "macos"
28 else "nixos";
29
30 # NixOS vs nix-darwin functions
31 systemFunc =
32 if darwin19 if darwin
33 then inputs.darwin.lib.darwinSystem20 then "darwinModules"
34 else nixpkgs.lib.nixosSystem;21 else "nixosModules"
3522 }.${
3623 b
37 # The config files for this system.24 };
38 hostConfig = configDir + "/configuration.nix";25
39 homeConfig = configDir + "/home.nix";26 # NixOS vs nix-darwin functions
4027 systemFunc =
41 hmModules =28 if darwin
42 if darwin29 then inputs.darwin.lib.darwinSystem
43 then inputs.home-manager.darwinModules30 else nixpkgs.lib.nixosSystem;
44 else inputs.home-manager.nixosModules;31
4532 userDir = ../users + "/${user}";
33 userConfig = import (userDir + "/user.nix");
34 hostDir = userDir + "/${host}";
35
36 hostConfigPath = hostDir + "/configuration.nix";
37 userConfigPath = userDir + "/configuration.nix";
38 hostHomePath = hostDir + "/home.nix";
39 userHomePath = userDir + "/home.nix";
40
41 # Arguments passed to all module files
42 args = {
43 inherit inputs;
44 currentSystem = system;
45 # Details about the host machine
46 host = {
47 inherit darwin;
48 };
49 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;
65 };
46 systemSettings = rec {66 systemSettings = rec {
47 inherit darwin;67 inherit darwin;
4868 homeDir = "/${
49 homeDir =
50 if darwin69 if darwin
51 then "/Users/" + userSettings.username + "/"70 then "Users"
52 else "/home/" + userSettings.username + "/";71 else "home"
5372 }/${userConfig.username}";
54 };73 };
55in74in
56 systemFunc {75 systemFunc {
57 inherit system;76 inherit system;
5877
59 # TODO: gross and ugly hack do NOT like78 modules =
60 specialArgs = {79 builtins.filter (f: f != null)
61 inherit (userSettings) darwinTiling;80 [
62 };81 # Apply our overlays. Overlays are keyed by system type so we have
6382 # to go through and apply our system type. We do this first so
64 modules =83 # the overlays are available globally.
65 [84 {nixpkgs.overlays = overlays;}
66 # Apply our overlays. Overlays are keyed by system type so we have85
67 # to go through and apply our system type. We do this first so86 # Modules shared between nix-darwin and NixOS
68 # the overlays are available globally.87 ../modules/shared
69 {nixpkgs.overlays = overlays;}88 # Modules for the specific OS
7089 (
71 # Shared modules90 if darwin
72 ../modules/shared91 then ../modules/macos
7392 else ../modules/nixos
74 # System specific modules93 )
75 ../modules/${systemModuleDir}94
7695 # The user-wide configuration.nix
77 # Link to configuration.nix96 (
78 hostConfig97 if pathExists userConfigPath
7998 then userConfigPath
80 # Set up nix-index and enable comma for easy one-shot command use99 else null
81 # https://github.com/nix-community/comma100 )
82 nixindex101 # The host-wide configuration.nix
83 {programs.nix-index-database.comma.enable = true;}102 (
84103 if host != null && pathExists hostConfigPath
85 # Themes for all programs104 then hostConfigPath
86 stylix105 else null
87106 )
88 hmModules.home-manager107
89 {108 # Set up nix-index and enable comma for easy one-shot command use
90 home-manager = {109 # https://github.com/nix-community/comma
91 useGlobalPkgs = true;110 (getInputModule "nix-index-database" "nix-index")
92 useUserPackages = true;111 {programs.nix-index-database.comma.enable = true;}
93 backupFileExtension = "hm-backup";112
94 extraSpecialArgs = {inherit inputs userSettings systemSettings;};113 # Themes for all programs
95 users.${userSettings.username} = homeConfig;114 (getInputModule "stylix" "stylix")
96 };115
97116 # Home manager
98 users.users.${userSettings.username}.home = systemSettings.homeDir;117 (getInputModule "home-manager" "home-manager")
99 }118 {
100119 home-manager = {
101 # We expose some extra arguments so that our modules can parameterize120 useGlobalPkgs = true;
102 # better based on these values.121 useUserPackages = true;
103 {122 backupFileExtension = "hm-backup";
104 config._module.args = {123 # Arguments passed to all module files
105 currentSystem = system;124 extraSpecialArgs =
106 # currentSystemName = name;125 args
107 # currentSystemUser = userSettings.username;126 // {
108127 mainHomeImports = builtins.filter (f: f != null) [
109 inherit inputs userSettings systemSettings;128 (
110 };129 if pathExists userHomePath
111 }130 then userHomePath
112 ]131 else null
113 # Add extra modules specified from config132 )
114 ++ extraModules;133 (
115 }134 if host != null && pathExists hostHomePath
135 then hostHomePath
136 else null
137 )
138 ];
139 };
140 # can't find how to make this an array without the param
141 users.${userConfig.username} = ../modules/home-manager.nix;
142 };
143 users.users.${userConfig.username}.home = systemSettings.homeDir;
144 }
145
146 # Arguments passed to all module files
147 {config._module.args = args;}
148 ]
149 # Add extra modules specified from config
150 ++ extraModules;
151 }
modules/home-manager.nix created+81
...@@ -0,0 +1,81 @@
1# This contains default configurations for set of programs
2# and configuration, but does not enable many things on it's own.
3{
4 pkgs,
5 lib,
6 config,
7 user,
8 host,
9 mainHomeImports,
10 ...
11}: let
12 cfg = config.programs;
13in {
14 imports = mainHomeImports;
15 programs = {
16 home-manager.enable = true;
17 nix-index.enable = true;
18
19 direnv = {
20 enableZshIntegration = true;
21 nix-direnv.enable = config.programs.direnv.enable;
22 };
23
24 git = {
25 enable = true;
26 userName = lib.mkDefault user.name;
27 userEmail = lib.mkDefault user.email;
28 ignores = [
29 (lib.mkIf host.darwin ".DS_Store") # When using Finder
30 (lib.mkIf host.darwin "._*") # When using non-APFS drives
31 # ViM and Neovim
32 ".*.swp"
33 ".nvimlog"
34 ];
35 };
36
37 atuin = {
38 enableBashIntegration = true;
39 enableFishIntegration = true;
40 daemon.enable = cfg.atuin.enable;
41 };
42 bat = {
43 extraPackages = with pkgs.bat-extras; [batdiff batman batgrep batwatch batpipe prettybat];
44 };
45 hyfetch = {
46 settings = {
47 backend = "fastfetch";
48 preset = user.sexuality;
49 mode = "rgb";
50 light_dark = "dark";
51 lightness = {
52 };
53 color_align = {
54 mode = "horizontal";
55 };
56 };
57 };
58 fastfetch.enable = cfg.hyfetch.enable;
59
60 fish = {
61 plugins = [
62 {
63 name = "tide";
64 inherit (pkgs.fishPlugins.tide) src;
65 }
66 {
67 name = "!!";
68 inherit (pkgs.fishPlugins.bang-bang) src;
69 }
70 ];
71 shellAliases =
72 { } // lib.optionalAttrs (!host.darwin) {
73 reboot-windows = "sudo efibootmgr --bootnext 0000; sudo reboot -h now";
74 };
75 shellInit = ''
76 batman --export-env | source
77 '';
78 ##test -r '/Users/${user.username}/.opam/opam-init/init.fish' && source '/Users/${user.username}/.opam/opam-init/init.fish' > /dev/null 2> /dev/null; or true
79 };
80 };
81}
modules/macos/default.nix+7-7
...@@ -1,13 +1,13 @@...@@ -1,13 +1,13 @@
1{1{
2 pkgs,2 pkgs,
3 lib,3 lib,
4 darwinTiling,
5 ...4 ...
6}: {5}: {
7 imports =6 imports = [
8 [7 # sort-lines: start
9 ./homebrew.nix8 ./mac-app-store.nix
10 ./system.nix9 ./system.nix
11 ]10 ./icons.nix
12 ++ lib.optionals darwinTiling [./tiling];11 # sort-lines: end
12 ];
13}13}
modules/macos/homebrew.nix deleted-31
...@@ -1,31 +0,0 @@
1_: {
2 # Use homebrew to install casks and Mac App Store apps
3 homebrew = {
4 enable = true;
5
6 onActivation = {
7 autoUpdate = true;
8 cleanup = "none";
9 upgrade = true;
10 };
11
12 brews = [
13 "imagemagick"
14 "opam"
15 ];
16
17 casks = [
18 "battle-net"
19 "stremio"
20 "alt-tab"
21 "legcord"
22 "zulip"
23 "zen-browser"
24 "supertuxkart"
25 ];
26
27 masApps = {
28 "wireguard" = 1451685025;
29 };
30 };
31}
modules/macos/mac-app-store.nix created+44
...@@ -0,0 +1,44 @@
1{
2 config,
3 lib,
4 pkgs,
5 ...
6}: let
7 types = lib.types;
8
9 # Mapping of Mac App Store applications.
10 # Add new entries to this list via the App Store's share button
11 # https://apps.apple.com/us/app/logic-pro/id634148309?mt=12
12 # --------- ID HERE
13 allMasApps = {
14 # sort-lines:start
15 adguard = 1440147259;
16 final-cut-pro = 424389933;
17 logic-pro = 634148309;
18 magnet = 441258766;
19 motion = 434290957;
20 wireguard = 1451685025;
21 # sort-lines:end
22 };
23
24 # the resolved configuration from the user
25 masApps = config.shared.darwin.macAppStoreApps;
26in {
27 options = {
28 # Installs Mac Applications via name using homebrew.
29 shared.darwin.macAppStoreApps = lib.mkOption {
30 type = types.listOf types.str;
31 default = [];
32 };
33 };
34 config = lib.mkIf (builtins.length masApps > 0) {
35 homebrew.enable = true;
36 homebrew.masApps = builtins.listToAttrs (
37 builtins.map (name: {
38 inherit name;
39 value = allMasApps.${name};
40 })
41 masApps
42 );
43 };
44}
modules/macos/system.nix+10-10
...@@ -1,21 +1,23 @@...@@ -1,21 +1,23 @@
1{1{
2 config,
2 pkgs,3 pkgs,
3 userSettings,4 lib,
4 ...5 ...
5}: {6}: {
6 #Use touchid or watch to activate sudo7 # Use touchid or watch to activate sudo
7 security.pam.services.sudo_local = {8 security.pam.services.sudo_local = {
8 enable = true;9 enable = true;
9 reattach = true;10 reattach = true;
10 touchIdAuth = true;11 touchIdAuth = true;
11 };12 };
12 # set some OSX preferences that I always end up hunting down and changing.13
14 # Set some OSX preferences that I always end up hunting down and changing.
13 system = {15 system = {
14 # Used for backwards compatibility, please read the changelog before changing.16 # Used for backwards compatibility, please read the changelog before changing.
15 # $ darwin-rebuild changelog17 # $ darwin-rebuild changelog
16 stateVersion = 6;18 stateVersion = 6;
1719
18 defaults = {20 defaults = lib.mkDefault {
19 # Turn quarantine off21 # Turn quarantine off
20 LaunchServices = {22 LaunchServices = {
21 LSQuarantine = false;23 LSQuarantine = false;
...@@ -50,13 +52,13 @@...@@ -50,13 +52,13 @@
50 AppleICUForce24HourTime = true;52 AppleICUForce24HourTime = true;
5153
52 #Autohide menu bar54 #Autohide menu bar
53 _HIHideMenuBar = userSettings.darwinTiling;55 #_HIHideMenuBar = config.shared.darwin.tiling;
54 };56 };
55 # minimal dock57 # minimal dock
56 dock = {58 dock = {
57 autohide = true;59 autohide = true;
58 #instant hide and show60 autohide-time-modifier = 0.0; # make animation instant
59 autohide-time-modifier = 0.0;61 autohide-delay = 0.0; # remove delay when touching bottom of screen
60 show-process-indicators = true;62 show-process-indicators = true;
6163
62 expose-group-apps = true;64 expose-group-apps = true;
...@@ -76,13 +78,12 @@...@@ -76,13 +78,12 @@
76 AppleShowAllExtensions = true;78 AppleShowAllExtensions = true;
77 ShowPathbar = true;79 ShowPathbar = true;
78 FXEnableExtensionChangeWarning = false;80 FXEnableExtensionChangeWarning = false;
81 # TODO: default to list view and not saving .DS_Store
79 };82 };
80
81 CustomSystemPreferences = {83 CustomSystemPreferences = {
82 "com.apple.universalaccess" = {84 "com.apple.universalaccess" = {
83 closeViewTrackpadGestureZoomEnabled = 1;85 closeViewTrackpadGestureZoomEnabled = 1;
84 };86 };
85
86 "com.apple.symbolichotkeys" = {87 "com.apple.symbolichotkeys" = {
87 AppleSymbolicHotKeys = {88 AppleSymbolicHotKeys = {
88 "64" = {89 "64" = {
...@@ -92,7 +93,6 @@...@@ -92,7 +93,6 @@
92 };93 };
93 };94 };
94 };95 };
95
96 # Bind caps to escape for better normal mode stuff96 # Bind caps to escape for better normal mode stuff
97 keyboard = {97 keyboard = {
98 enableKeyMapping = true;98 enableKeyMapping = true;
modules/macos/tiling/default.nix-4
...@@ -1,6 +1,2 @@...@@ -1,6 +1,2 @@
1{pkgs, ...}: {1{pkgs, ...}: {
2 imports = [
3 ./aerospace.nix
4 ./sketchybar.nix
5 ];
6}2}
modules/shared/default.nix+4-1
...@@ -1,6 +1,9 @@...@@ -1,6 +1,9 @@
1# shared is used by nixos-rebuild and darwin-rebuild
1{pkgs, ...}: {2{pkgs, ...}: {
2 imports = [3 imports = [
3 ./extras.nix4 # sort-lines:start
5 ./user-system-settings.nix
4 ./nix.nix6 ./nix.nix
7 # sort-lines:end
5 ];8 ];
6}9}
modules/shared/extras.nix deleted-51
...@@ -1,51 +0,0 @@
1{
2 pkgs,
3 userSettings,
4 ...
5}: {
6 services.tailscale.enable = true;
7
8 networking = {
9 };
10 fonts.packages = with pkgs; [
11 nerd-fonts.fira-code
12 nerd-fonts.iosevka
13 iosevka
14 nerd-fonts.symbols-only
15 nerd-fonts.iosevka
16 ];
17
18 # Set your time zone.
19 time.timeZone = userSettings.timeZone;
20
21 home-manager.users.${userSettings.username}.home.sessionVariables = {
22 EDITOR = userSettings.editor;
23 VISUAL = userSettings.editor;
24 TERMINAL = userSettings.term;
25 BROWSER = userSettings.browser;
26 };
27
28 stylix = {
29 enable = true;
30 base16Scheme = "${pkgs.base16-schemes}/share/themes/${userSettings.theme}.yaml";
31
32 fonts = {
33 serif = {
34 package = pkgs.nerd-fonts.${userSettings.font};
35 name = "${userSettings.font} Nerd Font";
36 };
37 sansSerif = {
38 package = pkgs.nerd-fonts.${userSettings.font};
39 name = "${userSettings.font} Nerd Font";
40 };
41 monospace = {
42 package = pkgs.nerd-fonts.${userSettings.font};
43 name = "${userSettings.font} Nerd Font";
44 };
45 emoji = {
46 package = pkgs.twemoji-color-font;
47 name = "Twemoji Color";
48 };
49 };
50 };
51}
modules/shared/homeManagerPrograms.nix deleted-67
...@@ -1,67 +0,0 @@
1{
2 pkgs,
3 lib,
4 userSettings,
5 systemSettings,
6 ...
7}: {
8 nix-index.enable = true;
9 atuin = {
10 enable = true;
11 enableBashIntegration = true;
12 enableFishIntegration = true;
13 daemon.enable = true;
14 };
15
16 direnv = {
17 enable = true;
18 enableZshIntegration = true;
19 nix-direnv.enable = true;
20 };
21
22 bat = {
23 enable = true;
24 extraPackages = with pkgs.bat-extras; [batdiff batman batgrep batwatch batpipe prettybat];
25 };
26
27 hyfetch = {
28 enable = true;
29 settings = {
30 backend = "fastfetch";
31 preset = userSettings.sexuality;
32 mode = "rgb";
33 light_dark = "dark";
34 lightness = {
35 };
36 color_align = {
37 mode = "horizontal";
38 };
39 };
40 };
41
42 fish = {
43 enable = true;
44
45 plugins = [
46 {
47 name = "tide";
48 inherit (pkgs.fishPlugins.tide) src;
49 }
50 {
51 name = "!!";
52 inherit (pkgs.fishPlugins.bang-bang) src;
53 }
54 ];
55 shellAliases =
56 {
57 }
58 // lib.optionalAttrs (!systemSettings.darwin) {
59 reboot-windows = "sudo efibootmgr --bootnext 0000; sudo reboot -h now";
60 };
61 shellInit = ''
62 batman --export-env | source
63 '';
64 ##test -r '/Users/${userSettings.username}/.opam/opam-init/init.fish' && source '/Users/${userSettings.username}/.opam/opam-init/init.fish' > /dev/null 2> /dev/null; or true
65 };
66 home-manager.enable = true;
67}
modules/shared/packages.nix deleted-120
...@@ -1,120 +0,0 @@
1{
2 pkgs,
3 systemSettings,
4 ...
5}:
6with pkgs; [
7 #general development
8 just
9 pkg-config
10 gnumake
11 caddy
12 pm2
13 clang-tools
14 wget
15 git
16 unzip
17 clang
18 cmake
19 gnupg
20
21 #ides
22 zed-editor
23 emacs
24
25 #virtualization
26 qemu
27 podman
28 docker
29
30 #productivity
31 glance
32 anki-bin
33 tailscale
34 openconnect
35
36 #nix tools
37 cachix
38 direnv
39 nh
40
41 #terminal stuff
42 (btop.override {cudaSupport = true;})
43 tmux
44 zellij
45 lazygit
46 fzf
47 neofetch
48 hyfetch
49 fastfetch
50 eza
51 ollama
52 uv
53 fd
54 ripgrep
55 file
56 fish
57
58 #image tools
59 imagemagick
60
61 #chatting apps
62 (discord.override {
63 withMoonlight = true;
64 })
65 vesktop
66
67 #media
68 spotify
69 zathura
70
71 #language servers
72 typst-live
73 lua-language-server
74 nil
75 nixd
76 texlab
77 texlivePackages.chktex
78
79 #formatters/linters
80 stylua
81 alejandra
82 statix
83
84 #neovim deps
85 lua51Packages.lua
86 lua51Packages.luarocks-nix
87 codespell
88 typst
89 tree-sitter
90
91 #python
92 pyright
93 basedpyright
94 ruff
95 python312Packages.python
96 python312Packages.pynvim
97 python312Packages.pip
98
99 #programming languages
100 R
101 deno
102 ruby
103 nodePackages.npm
104 go
105 coq
106 elan
107
108 #browsers
109 tor
110 firefox
111
112 #math
113 texlive.combined.scheme-full
114 zathura
115
116 #fun things
117 cowsay
118 cmatrix
119 sl
120]
modules/shared/user-system-settings.nix created+36
...@@ -0,0 +1,36 @@
1# applies user settings for the system
2{ pkgs, user, lib, ... }: {
3 # Set your time zone.
4 time.timeZone = user.timeZone;
5
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 };
12
13 stylix = {
14 enable = false;
15 base16Scheme = "${pkgs.base16-schemes}/share/themes/${user.theme}.yaml";
16
17 fonts = {
18 serif = {
19 package = pkgs.nerd-fonts.${user.font};
20 name = "${user.font} Nerd Font";
21 };
22 sansSerif = {
23 package = pkgs.nerd-fonts.${user.font};
24 name = "${user.font} Nerd Font";
25 };
26 monospace = {
27 package = pkgs.nerd-fonts.${user.font};
28 name = "${user.font} Nerd Font";
29 };
30 emoji = {
31 package = pkgs.twemoji-color-font;
32 name = "Twemoji Color";
33 };
34 };
35 };
36}
oldflake.nix deleted-47
...@@ -1,47 +0,0 @@
1{
2 description = "My first flake!";
3
4 inputs = {
5 nixpkgs.url = "nixpkgs/nixos-23.11";
6 home-manager = {
7 url = "github:nix-community/home-manager/release-23.11";
8 inputs.nixpkgs.follows = "nixpkgs";
9 };
10 # nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=<0.2.0>";
11
12 # hyprland.url = "github:hyprwm/Hyprland";
13 # hyprland-plugins = {
14 # url = "github:hyprwm/hyprland-plugins";
15 # inputs.hyprland.follows = "hyprland";
16 # };
17 # use the following for unstable:
18 # nixpkgs.url = "nixpkgs/nixos-unstable";
19
20 # or any branch you want:
21 # nixpkgs.url = "nixpkgs/{BRANCH-NAME}"
22 };
23
24 outputs = {
25 self,
26 home-manager,
27 nixpkgs,
28 ...
29 }: let
30 system = "x86_64-linux";
31 lib = nixpkgs.lib;
32 pkgs = nixpkgs.legacyPackages.${system};
33 in {
34 nixosConfigurations = {
35 nmarks = lib.nixosSystem {
36 inherit system;
37 modules = [./configuration.nix];
38 };
39 };
40 homeConfigurations = {
41 nmarks = home-manager.lib.homeManagerConfiguration {
42 inherit pkgs;
43 modules = [./home.nix];
44 };
45 };
46 };
47}
readme.md created+40
...@@ -0,0 +1,40 @@
1# nix config
2
3meow.
4
5## macOS installation instructions
6
7Install Nix using the upstream nix (Pick "no" then "yes):
8
9```
10curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | \
11 sh -s -- install
12```
13
14Open a new shell and clone the repository:
15
16```
17# Install git + other command tools. (Used by many programs)
18xcode-select --install
19
20# Clone via HTTPs
21git clone https://git.paperclover.net/clo/config.git
22# With SSH Authentication
23git clone git@git.paperclover.net:clo/config
24```
25
26Setup `nix-darwin`
27```
28# Tell nix-darwin where the flake is at.
29sudo mkdir /etc/nix-darwin
30sudo ln -s $(realpath flake.nix) /etc/nix-darwin/
31
32# Enable configuration.
33nix run .#darwin-rebuild switch
34```
35
36Additionally, it may be helpful to disable the unsigned app popup.
37```
38sudo spctl --master-disable
39# then, go to System Settings -> Privacy to allow unsigned apps.
40```
switch created+12
...@@ -0,0 +1,12 @@
1#!/bin/sh
2nh_subcommand="os"
3fallback_command="nixos-rebuild"
4if [ "$(uname -o)" ]; then
5 nh_subcommand="darwin"
6 fallback_command="nix run .#darwin-rebuild"
7fi;
8if command -v nh > /dev/null; then
9 nh $nh_subcommand switch .
10else
11 $fallback_command switch
12fi
users/chloe/configuration.nix+17-17
...@@ -1,3 +1,4 @@...@@ -1,3 +1,4 @@
1# Configuration applied to all of chloe's machines
1{2{
2 pkgs,3 pkgs,
3 userSettings,4 userSettings,
...@@ -5,24 +6,23 @@...@@ -5,24 +6,23 @@
5}: {6}: {
6 environment.systemPackages = with pkgs; [7 environment.systemPackages = with pkgs; [
7 neovim8 neovim
8 pinentry_mac
9 signal-desktop-bin
10 ];9 ];
1110 shared.darwin = {
12 # Create /etc/zshrc that loads the nix-darwin environment.11 macAppStoreApps = [
13 programs = {12 "adguard"
14 gnupg.agent.enable = true;13 "magnet"
15 zsh.enable = true; # default shell on catalina14 ];
16 };15 };
1716 system.defaults = {
18 # When opening an interactive shell that isnt fish move into fish17 NSGlobalDomain = {
19 programs.zsh = {18 KeyRepeat = 1;
20 interactiveShellInit = ''19 InitialKeyRepeat = 10;
21 if [[ $(${pkgs.procps}/bin/ps -p $PPID -o comm) != "fish" && -z ''${ZSH_EXUCTION_STRING} ]]20 };
22 then21 CustomUserPreferences = {
23 [[ -o login ]] && LOGIN_OPTION='--login' || LOGIN_OPTION=""22 NSGlobalDomain = {
24 exec ${pkgs.fish}/bin/fish $LOGIN_OPTION23 # TODO: how to change system accent color
25 fi24 AppleHighlightColor = "1.000000 0.874510 0.701961 Orange";
26 '';25 };
26 };
27 };27 };
28}28}
users/chloe/home.nix+13-18
...@@ -1,29 +1,24 @@...@@ -1,29 +1,24 @@
1{1{
2 inputs,2 inputs,
3 config,
4 pkgs,3 pkgs,
5 lib,4 lib,
6 userSettings,
7 systemSettings,
8 ...5 ...
9}: {6}: {
10 imports = [
11 inputs.nixvim.homeManagerModules.nixvim
12 #set up nixvim
13 # ../../modules/nixvim
14 ];
15 programs = import ../../modules/shared/homeManagerPrograms.nix {inherit inputs config pkgs lib userSettings systemSettings;};
16
17 home = {7 home = {
18 inherit (userSettings) username;
19 # homeDirectory = systemSettings.homeConfig;
20 # shell = pkgs.fish;
21 stateVersion = "23.05"; # Please read the comment before changing.8 stateVersion = "23.05"; # Please read the comment before changing.
229 packages = [
23 packages = pkgs.callPackage ../../modules/shared/packages.nix {inherit systemSettings;};10 pkgs.neovim
2411 pkgs.nh
25 sessionPath = [12 pkgs.ffmpeg
26 "$HOME/.emacs.d/bin"
27 ];13 ];
28 };14 };
15 programs = {
16 # sort-lines:start
17 hyfetch.enable = true;
18 zsh.enable = true;
19 # sort-lines:end
20
21 # use a git-specific email
22 git.userEmail = "git@paperclover.net";
23 };
29}24}
users/chloe/sandwich/configuration.nix created+14
...@@ -0,0 +1,14 @@
1# Configuration applied to all of chloe's machines
2{pkgs, ...}: {
3 environment.systemPackages = with pkgs; [
4 ffmpeg
5 ripgrep
6 ];
7 shared.darwin = {
8 macAppStoreApps = [
9 "final-cut-pro"
10 "logic-pro"
11 "motion"
12 ];
13 };
14}
users/chloe/user.nix created+18
...@@ -0,0 +1,18 @@
1# This definition is used by modules to customize as needed.
2{
3 username = "clo"; # username
4 name = "chloe caruso";
5 email = "account@paperclover.net";
6 timeZone = "America/Los_Angeles";
7
8 dotfilesDir = "~/config"; # absolute path of the local repo
9
10 # Stylix/Theming
11 theme = "catppuccin-mocha";
12 #font
13 sexuality = "lesbian"; # hyfetch
14
15 # Default terminal command. NOTE: ghostty is not installed for you
16 term = "ghostty"; # preferred $TERMINAL
17 editor = "nvim"; # preferred $EDITOR
18}
users/natalie/configuration.nix created+1
...@@ -0,0 +1 @@
1services.tailscale.enable = true;
users/natalie/glance.yml created+108
...@@ -0,0 +1,108 @@
1pages:
2 - name: Home
3 # Optionally, if you only have a single page you can hide the desktop navigation for a cleaner look
4 # hide-desktop-navigation: true
5 columns:
6 - size: small
7 widgets:
8 - type: calendar
9 first-day-of-week: monday
10
11 - type: rss
12 limit: 10
13 collapse-after: 3
14 cache: 12h
15 feeds:
16 - url: https://selfh.st/rss/
17 title: selfh.st
18 limit: 4
19 - url: https://ciechanow.ski/atom.xml
20 - url: https://www.joshwcomeau.com/rss.xml
21 title: Josh Comeau
22 - url: https://samwho.dev/rss.xml
23 - url: https://ishadeed.com/feed.xml
24 title: Ahmad Shadeed
25
26 - type: twitch-channels
27 channels:
28 - theprimeagen
29 - j_blow
30 - piratesoftware
31 - cohhcarnage
32 - christitustech
33 - EJ_SA
34
35 - size: full
36 widgets:
37 - type: group
38 widgets:
39 - type: hacker-news
40 - type: lobsters
41
42 - type: videos
43 channels:
44 - UCXuqSBlHAE6Xw-yeJA0Tunw # Linus Tech Tips
45 - UCR-DXc1voovS8nhAvccRZhg # Jeff Geerling
46 - UCsBjURrPoezykLs9EqgamOA # Fireship
47 - UCBJycsmduvYEL83R_U4JriQ # Marques Brownlee
48 - UCHnyfMqiRRG1u-2MsSQLbXA # Veritasium
49
50 - type: group
51 widgets:
52 - type: reddit
53 subreddit: technology
54 show-thumbnails: true
55 - type: reddit
56 subreddit: selfhosted
57 show-thumbnails: true
58
59 - size: small
60 widgets:
61 - type: weather
62 location: London, United Kingdom
63 units: metric # alternatively "imperial"
64 hour-format: 12h # alternatively "24h"
65 # Optionally hide the location from being displayed in the widget
66 # hide-location: true
67
68 - type: markets
69 # The link to go to when clicking on the symbol in the UI,
70 # {SYMBOL} will be substituded with the symbol for each market
71 symbol-link-template: https://www.tradingview.com/symbols/{SYMBOL}/news
72 markets:
73 - symbol: SPY
74 name: S&P 500
75 - symbol: BTC-USD
76 name: Bitcoin
77 - symbol: NVDA
78 name: NVIDIA
79 - symbol: AAPL
80 name: Apple
81 - symbol: MSFT
82 name: Microsoft
83
84 - type: releases
85 cache: 1d
86 # Without authentication the Github API allows for up to 60 requests per hour. You can create a
87 # read-only token from your Github account settings and use it here to increase the limit.
88 # token: ...
89 repositories:
90 - glanceapp/glance
91 - go-gitea/gitea
92 - immich-app/immich
93 - syncthing/syncthing
94
95 # Add more pages here:
96 # - name: Your page name
97 # columns:
98 # - size: small
99 # widgets:
100 # # Add widgets here
101
102 # - size: full
103 # widgets:
104 # # Add widgets here
105
106 # - size: small
107 # widgets:
108 # # Add widgets here
users/natalie/home.nix created+19
...@@ -0,0 +1,19 @@
1{
2 pkgs,
3 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
11
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 ];
19}
users/natalie/laptop/configuration.nix+32
...@@ -9,6 +9,12 @@...@@ -9,6 +9,12 @@
9 signal-desktop-bin9 signal-desktop-bin
10 ];10 ];
1111
12 # Custom configuration modules in "modules" are shared between users,
13 # and can be configured in this "shared" namespace
14 shared.darwin = {
15 macAppStoreApps = ["wireguard"];
16 };
17
12 # Create /etc/zshrc that loads the nix-darwin environment.18 # Create /etc/zshrc that loads the nix-darwin environment.
13 programs = {19 programs = {
14 gnupg.agent.enable = true;20 gnupg.agent.enable = true;
...@@ -25,4 +31,30 @@...@@ -25,4 +31,30 @@
25 fi31 fi
26 '';32 '';
27 };33 };
34
35 # Use homebrew to install casks
36 homebrew = {
37 enable = true;
38
39 onActivation = {
40 autoUpdate = true;
41 cleanup = "none";
42 upgrade = true;
43 };
44
45 brews = [
46 "imagemagick"
47 "opam"
48 ];
49
50 casks = [
51 "battle-net"
52 "stremio"
53 "alt-tab"
54 "legcord"
55 "zulip"
56 "zen-browser"
57 "supertuxkart"
58 ];
59 };
28}60}
users/natalie/laptop/home.nix+2-3
...@@ -6,17 +6,16 @@...@@ -6,17 +6,16 @@
6 userSettings,6 userSettings,
7 systemSettings,7 systemSettings,
8 ...8 ...
9}: {9} @ args: {
10 imports = [10 imports = [
11 inputs.nixvim.homeManagerModules.nixvim11 inputs.nixvim.homeManagerModules.nixvim
12 #set up nixvim12 #set up nixvim
13 # ../../modules/nixvim13 # ../../modules/nixvim
14 ];14 ];
15 programs = import ../../modules/shared/homeManagerPrograms.nix {inherit inputs config pkgs lib userSettings systemSettings;};15 programs = import ./home-programs.nix args;
1616
17 home = {17 home = {
18 inherit (userSettings) username;18 inherit (userSettings) username;
19 # homeDirectory = systemSettings.homeConfig;
20 # shell = pkgs.fish;19 # shell = pkgs.fish;
21 stateVersion = "23.05"; # Please read the comment before changing.20 stateVersion = "23.05"; # Please read the comment before changing.
2221
users/natalie/packages.nix created+120
...@@ -0,0 +1,120 @@
1{
2 pkgs,
3 systemSettings,
4 ...
5}:
6with pkgs; [
7 #general development
8 just
9 pkg-config
10 gnumake
11 caddy
12 pm2
13 clang-tools
14 wget
15 git
16 unzip
17 clang
18 cmake
19 gnupg
20
21 #ides
22 zed-editor
23 emacs
24
25 #virtualization
26 qemu
27 podman
28 docker
29
30 #productivity
31 glance
32 anki-bin
33 tailscale
34 openconnect
35
36 #nix tools
37 cachix
38 direnv
39 nh
40
41 #terminal stuff
42 (btop.override {cudaSupport = true;})
43 tmux
44 zellij
45 lazygit
46 fzf
47 neofetch
48 hyfetch
49 fastfetch
50 eza
51 ollama
52 uv
53 fd
54 ripgrep
55 file
56 fish
57
58 #image tools
59 imagemagick
60
61 #chatting apps
62 (discord.override {
63 withMoonlight = true;
64 })
65 vesktop
66
67 #media
68 spotify
69 zathura
70
71 #language servers
72 typst-live
73 lua-language-server
74 nil
75 nixd
76 texlab
77 texlivePackages.chktex
78
79 #formatters/linters
80 stylua
81 alejandra
82 statix
83
84 #neovim deps
85 lua51Packages.lua
86 lua51Packages.luarocks-nix
87 codespell
88 typst
89 tree-sitter
90
91 #python
92 pyright
93 basedpyright
94 ruff
95 python312Packages.python
96 python312Packages.pynvim
97 python312Packages.pip
98
99 #programming languages
100 R
101 deno
102 ruby
103 nodePackages.npm
104 go
105 coq
106 elan
107
108 #browsers
109 tor
110 firefox
111
112 #math
113 texlive.combined.scheme-full
114 zathura
115
116 #fun things
117 cowsay
118 cmatrix
119 sl
120]