├── LICENSE.md
├── README.md
├── docs
├── HOW.md
├── INSTALL.md
├── README.md
└── images
│ └── rice
│ └── v1
│ ├── cli.png
│ ├── rice.png
│ ├── rofi.png
│ └── term.png
├── flake.lock
├── flake.nix
├── home
├── cli.nix
├── files.nix
├── firefox.nix
├── git.nix
├── gtk.nix
├── home.nix
├── izrss.nix
├── nix-settings.nix
├── nushell.nix
├── options.nix
├── starship.nix
├── tools.nix
└── xdg.nix
└── system
├── boot.nix
├── configuration.nix
├── desktop.nix
├── environment.nix
├── fonts.nix
├── hardware-configuration.nix
├── locale.nix
├── networking.nix
├── nix-settings.nix
├── options.nix
├── services.nix
├── sound.nix
├── sys.nix
└── users.nix
/LICENSE.md:
--------------------------------------------------------------------------------
1 | ### MIT License
2 |
3 | Copyright © 2024 `0fie`
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ###### You're too late, it's gone now.
This is what it looked like 👇
2 |
3 |
4 |
5 |

6 | Screenshot last updated 21 April
7 |
8 | ### 🖼️ Gallery
9 |
10 |
11 |
12 | "click to expand"
13 |
14 |
15 | Kitty + Nushell + Starship + Cava
16 | 
17 |
18 |
19 |
20 | App Launcher (rofi-wayland)
21 | 
22 |
23 |
24 |
25 | Neovim (left) and Yazi (right)
26 | 
27 |
28 |
29 |
30 |
31 |
32 | ###### You can go to [this commit](https://github.com/0fie/Maika/tree/d93a048fe8f69b9bdebd44c81748bbfff3223a03) to get the config files for the rice above.
Береги себя
33 |
--------------------------------------------------------------------------------
/docs/HOW.md:
--------------------------------------------------------------------------------
1 | #### How theming works?
2 |
3 | I use [Catppuccin](https://github.com/catppuccin) system-wide, from GRUB to Hyprland. To ensure that all apps follow this color scheme, I'm
4 | using [catppuccin/nix](https://github.com/catppuccin/nix). Inspect [home/home.nix](../home/home.nix) to see how I used it. To change the
5 | theme used by GTK apps, see [home/gtk.nix](../home/gtk.nix).
6 |
7 | #### How fonts work?
8 |
9 | The [system/options.nix](../system/options.nix) contains a variable called `fontName`. Apps like Kitty, Mako & Waybar read this variable to
10 | determine which font to use. It is **not** the actual font that will get installed. It just exists to let apps know what font to search for.
11 | Installing the actual font package is your responsibility. Suppose you want to switch to the Iosevka font system-wide; you'd first install the
12 | font like so:
13 |
14 | ```nix
15 | home.packages = [pkgs.iosevka];
16 |
17 | # Or alternatively
18 | fonts.packages = [pkgs.iosevka];
19 | ```
20 |
21 | And then modify the `fontName` variable in [system/options.nix](../system/options.nix) to make your Iosevka the default font everywhere.
22 |
--------------------------------------------------------------------------------
/docs/INSTALL.md:
--------------------------------------------------------------------------------
1 | #### How to install?
2 |
3 | This entire [home-manager](https://github.com/nix-community/home-manager) configuration can be installed on any machine running Nix. At least
4 | that's what I think. Assuming you're already using flakes, here are the commands to install it:
5 |
6 | ```nix
7 | bash -i
8 | export NIXPKGS_ALLOW_UNFREE=1
9 | NIX_CONFIG="experimental-features = nix-command flakes"
10 | nix shell nixpkgs#home-manager nixpkgs#git
11 | nix run home-manager/master -- init --switch
12 | home-manager switch --impure --flake .
13 | ```
14 |
15 | None of this was tested.
16 |
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | #### Even the simplest of NixOS systems needs some docs.
2 |
3 | These configurations will eventually become sophisticated and complex like others'. I'm writing these "docs/notes" so that I can
4 | revisit them when I forget something.
5 |
6 | ##### This is what I currently have:
7 |
8 | - [How stuff works](./HOW.md)
9 | - [How to install](./INSTALL.md)
10 |
--------------------------------------------------------------------------------
/docs/images/rice/v1/cli.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0fie/Maika/4bea6bd1bdd93d932e4ada0424605457f2b266ef/docs/images/rice/v1/cli.png
--------------------------------------------------------------------------------
/docs/images/rice/v1/rice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0fie/Maika/4bea6bd1bdd93d932e4ada0424605457f2b266ef/docs/images/rice/v1/rice.png
--------------------------------------------------------------------------------
/docs/images/rice/v1/rofi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0fie/Maika/4bea6bd1bdd93d932e4ada0424605457f2b266ef/docs/images/rice/v1/rofi.png
--------------------------------------------------------------------------------
/docs/images/rice/v1/term.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0fie/Maika/4bea6bd1bdd93d932e4ada0424605457f2b266ef/docs/images/rice/v1/term.png
--------------------------------------------------------------------------------
/flake.lock:
--------------------------------------------------------------------------------
1 | {
2 | "nodes": {
3 | "catppuccin": {
4 | "locked": {
5 | "lastModified": 1713895615,
6 | "narHash": "sha256-SVkxhcL0/IN5fNI2dqr702wXOnzktsm0LCEVGRAJQcY=",
7 | "owner": "catppuccin",
8 | "repo": "nix",
9 | "rev": "a48e70a31616cb63e4794fd3465bff1835cc4246",
10 | "type": "github"
11 | },
12 | "original": {
13 | "owner": "catppuccin",
14 | "repo": "nix",
15 | "type": "github"
16 | }
17 | },
18 | "firefox-addons": {
19 | "inputs": {
20 | "flake-utils": "flake-utils",
21 | "nixpkgs": [
22 | "nixpkgs"
23 | ]
24 | },
25 | "locked": {
26 | "dir": "pkgs/firefox-addons",
27 | "lastModified": 1714043889,
28 | "narHash": "sha256-f7aben2pbfL/CzphiAAwwe5CrmSYRZv3UF7zaGkD+Pc=",
29 | "owner": "rycee",
30 | "repo": "nur-expressions",
31 | "rev": "fee36e584de8c0034f311b76b5da1b81dad0b17b",
32 | "type": "gitlab"
33 | },
34 | "original": {
35 | "dir": "pkgs/firefox-addons",
36 | "owner": "rycee",
37 | "repo": "nur-expressions",
38 | "type": "gitlab"
39 | }
40 | },
41 | "flake-utils": {
42 | "locked": {
43 | "lastModified": 1629284811,
44 | "narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
45 | "owner": "numtide",
46 | "repo": "flake-utils",
47 | "rev": "c5d161cc0af116a2e17f54316f0bf43f0819785c",
48 | "type": "github"
49 | },
50 | "original": {
51 | "owner": "numtide",
52 | "repo": "flake-utils",
53 | "type": "github"
54 | }
55 | },
56 | "home-manager": {
57 | "inputs": {
58 | "nixpkgs": [
59 | "nixpkgs"
60 | ]
61 | },
62 | "locked": {
63 | "lastModified": 1714042918,
64 | "narHash": "sha256-4AItZA3EQIiSNAxliuYEJumw/LaVfrMv84gYyrs0r3U=",
65 | "owner": "nix-community",
66 | "repo": "home-manager",
67 | "rev": "0c5704eceefcb7bb238a958f532a86e3b59d76db",
68 | "type": "github"
69 | },
70 | "original": {
71 | "owner": "nix-community",
72 | "repo": "home-manager",
73 | "type": "github"
74 | }
75 | },
76 | "izrss": {
77 | "inputs": {
78 | "nixpkgs": [
79 | "nixpkgs"
80 | ]
81 | },
82 | "locked": {
83 | "lastModified": 1713648888,
84 | "narHash": "sha256-j92822Gg3Rz5jTSxQU+KNR6nbnTxjQj0dMCOvDdKaAQ=",
85 | "owner": "isabelroses",
86 | "repo": "izrss",
87 | "rev": "cfa2ffac3ef51ee2f3131538782d14b1980ebd45",
88 | "type": "github"
89 | },
90 | "original": {
91 | "owner": "isabelroses",
92 | "repo": "izrss",
93 | "type": "github"
94 | }
95 | },
96 | "nixpkgs": {
97 | "locked": {
98 | "lastModified": 1714076141,
99 | "narHash": "sha256-Drmja/f5MRHZCskS6mvzFqxEaZMeciScCTFxWVLqWEY=",
100 | "owner": "NixOS",
101 | "repo": "nixpkgs",
102 | "rev": "7bb2ccd8cdc44c91edba16c48d2c8f331fb3d856",
103 | "type": "github"
104 | },
105 | "original": {
106 | "id": "nixpkgs",
107 | "ref": "nixos-unstable",
108 | "type": "indirect"
109 | }
110 | },
111 | "root": {
112 | "inputs": {
113 | "catppuccin": "catppuccin",
114 | "firefox-addons": "firefox-addons",
115 | "home-manager": "home-manager",
116 | "izrss": "izrss",
117 | "nixpkgs": "nixpkgs"
118 | }
119 | }
120 | },
121 | "root": "root",
122 | "version": 7
123 | }
124 |
--------------------------------------------------------------------------------
/flake.nix:
--------------------------------------------------------------------------------
1 | {
2 | description = "0fie's ultra-simple NixOS Configuration.";
3 |
4 | inputs = {
5 | nixpkgs.url = "nixpkgs/nixos-unstable";
6 |
7 | home-manager = {
8 | url = "github:nix-community/home-manager";
9 | inputs.nixpkgs.follows = "nixpkgs";
10 | };
11 |
12 | catppuccin.url = "github:catppuccin/nix";
13 |
14 | izrss = {
15 | url = "github:isabelroses/izrss";
16 | inputs.nixpkgs.follows = "nixpkgs";
17 | };
18 |
19 | firefox-addons = {
20 | url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
21 | inputs.nixpkgs.follows = "nixpkgs";
22 | };
23 | };
24 |
25 | outputs = {
26 | self,
27 | nixpkgs,
28 | home-manager,
29 | ...
30 | } @ inputs: let
31 | inherit (import ./system/options.nix) hostName system;
32 | inherit (import ./home/options.nix) userName;
33 | pkgs = nixpkgs.legacyPackages.${system};
34 | in {
35 | homeConfigurations."${userName}" = home-manager.lib.homeManagerConfiguration {
36 | inherit pkgs;
37 | extraSpecialArgs = {inherit inputs;};
38 | modules = [./home/home.nix];
39 | };
40 |
41 | nixosConfigurations."${hostName}" = nixpkgs.lib.nixosSystem {
42 | specialArgs = {inherit inputs;};
43 | modules = [./system/configuration.nix];
44 | };
45 | };
46 | }
47 |
--------------------------------------------------------------------------------
/home/cli.nix:
--------------------------------------------------------------------------------
1 | {
2 | programs = {
3 | bat = {
4 | enable = true;
5 | catppuccin.enable = true;
6 | };
7 |
8 | cava = {
9 | enable = true;
10 | settings = {
11 | general = {
12 | bar_spacing = 0;
13 | bar_width = 1;
14 | };
15 | color = {
16 | gradient = 1;
17 | gradient_color_1 = "'#8bd5ca'";
18 | gradient_color_2 = "'#91d7e3'";
19 | gradient_color_3 = "'#7dc4e4'";
20 | gradient_color_4 = "'#8aadf4'";
21 | gradient_color_5 = "'#c6a0f6'";
22 | gradient_color_6 = "'#f5bde6'";
23 | gradient_color_7 = "'#ee99a0'";
24 | gradient_color_8 = "'#ed8796'";
25 | };
26 | };
27 | };
28 | };
29 | }
30 |
--------------------------------------------------------------------------------
/home/files.nix:
--------------------------------------------------------------------------------
1 | {
2 | xdg.configFile = {
3 | "vesktop/settings/settings.json".text = builtins.toJSON {
4 | notifyAboutUpdates = true;
5 | autoUpdate = false;
6 | autoUpdateNotification = false;
7 | useQuickCss = true;
8 | themeLinks = [
9 | "https://catppuccin.github.io/discord/dist/catppuccin-mocha.theme.css"
10 | "https://catppuccin.github.io/discord/dist/catppuccin-mocha-pink.theme.css"
11 | ];
12 | enabledThemes = [
13 | ];
14 | enableReactDevtools = false;
15 | frameless = false;
16 | transparent = false;
17 | winCtrlQ = false;
18 | disableMinSize = false;
19 | winNativeTitleBar = false;
20 | plugins = {
21 | BadgeAPI.enabled = true;
22 | ChatInputButtonAPI.enabled = true;
23 | CommandsAPI.enabled = true;
24 | ContextMenuAPI.enabled = true;
25 | MessageEventsAPI.enabled = true;
26 | NoticesAPI.enabled = true;
27 | ServerListAPI.enabled = true;
28 | NoTrack.enabled = true;
29 | Settings = {
30 | enabled = true;
31 | settingsLocation = "aboveActivity";
32 | };
33 | SupportHelper.enabled = true;
34 | AlwaysAnimate.enabled = true;
35 | AlwaysTrust.enabled = true; # remove "do you trust this link" dialogs.
36 | AnonymiseFileNames.enabled = true;
37 | BANger.enabled = false;
38 | BetterGifPicker.enabled = true;
39 | BetterSettings.enabled = true;
40 | BetterUploadButton.enabled = true;
41 | BlurNSFW.enabled = true;
42 | ClearURLs.enabled = true;
43 | CopyUserURLs.enabled = true;
44 | CrashHandler.enabled = true;
45 | EmoteCloner.enabled = true;
46 | Experiments.enabled = true;
47 | FavoriteEmojiFirst.enabled = true;
48 | LoadingQuotes.enabled = true;
49 | MemberCount.enabled = false;
50 | NSFWGateBypass.enabled = true;
51 | PermissionFreeWill.enabled = true;
52 | PreviewMessage.enabled = true;
53 | ReadAllNotificationsButton.enabled = true;
54 | RelationshipNotifier.enabled = true;
55 | ReverseImageSearch.enabled = true;
56 | ShowConnections.enabled = true;
57 | ShowHiddenChannels.enabled = true;
58 | SpotifyControls.enabled = true;
59 | UrbanDictionary.enabled = true;
60 | ValidUser.enabled = true;
61 | WebContextMenus = {
62 | enabled = true;
63 | addBack = true;
64 | };
65 | WebKeybinds = {
66 | enabled = true;
67 | };
68 | WhoReacted = {
69 | enabled = true;
70 | };
71 | };
72 |
73 | notifications = {
74 | timeout = 5000;
75 | position = "bottom-right";
76 | useNative = "not-focused";
77 | logLimit = 50;
78 | };
79 |
80 | # TODO: Investigate this.
81 | cloud = {
82 | authenticated = false;
83 | url = "https://api.vencord.dev/";
84 | settingsSync = false;
85 | settingsSyncVersion = 1713336128416;
86 | };
87 | };
88 | };
89 | }
90 |
--------------------------------------------------------------------------------
/home/firefox.nix:
--------------------------------------------------------------------------------
1 | {inputs, ...}:
2 | # Fetch the user's name and their full name from the home/options.nix file
3 | let
4 | inherit (import ./options.nix) userName userFullName;
5 | in {
6 | home.sessionVariables.BROWSER = "firefox";
7 |
8 | programs.firefox = {
9 | enable = true;
10 | profiles."${userName}" = {
11 | isDefault = true;
12 | name = "${userFullName}";
13 | path = "${userName}.default";
14 |
15 | extensions = with inputs.firefox-addons.packages."x86_64-linux"; [
16 | ublock-origin
17 | sponsorblock
18 | ];
19 |
20 | settings = {
21 | # Don't disable extensions dropped in to a system
22 | # location, or those owned by the application
23 | "extensions.autoDisableScopes" = 3;
24 |
25 | # Don't call home for blacklisting
26 | "extensions.blocklist.enabled" = false;
27 |
28 | # Prevent EULA dialog to popup on first run
29 | "browser.EULA.override" = true;
30 |
31 | # Extensions cannot be updated without permission
32 | "extensions.update.enabled" = false;
33 |
34 | # Release notes and vendor URLs
35 | "app.releaseNotesURL" = "http://127.0.0.1/";
36 | "app.vendorURL" = "http://127.0.0.1/";
37 | "app.privacyURL" = "http://127.0.0.1/";
38 |
39 | # Disable plugin installer
40 | "plugins.hide_infobar_for_missing_plugin" = true;
41 | "plugins.hide_infobar_for_outdated_plugin" = true;
42 | "plugins.notifyMissingFlash" = false;
43 |
44 | # Speeding it up
45 | "network.http.pipelining" = true;
46 | "network.http.proxy.pipelining" = true;
47 | "network.http.pipelining.maxrequests" = 10;
48 | "nglayout.initialpaint.delay" = 0;
49 | "nglayout.initialpaint.delay_in_oopif" = 0;
50 | "browser.startup.preXulSkeletonUI" = false;
51 | "content.notify.interval" = 100000;
52 |
53 | "browser.download.panel.shown" = true;
54 | "browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
55 | "browser.tabs.loadInBackground" = true;
56 | "dom.security.https_only_mode" = true;
57 | "privacy.trackingprotection.enabled" = true;
58 | "signon.rememberSignons" = true;
59 | "browser.toolbars.bookmarks.visibility" = "never";
60 |
61 | # Disable homecalling
62 | "app.update.url" = "http://127.0.0.1/";
63 | "startup.homepage_welcome_url" = "";
64 | "browser.startup.homepage_override.mstone" = "ignore";
65 | "datareporting.policy.dataSubmissionEnabled" = false;
66 | "datareporting.healthreport.uploadEnabled" = false;
67 | "datareporting.healthreport.about.reportUrl" = "http://127.0.0.1/";
68 | "datareporting.healthreport.service.enabled" = false;
69 | "datareporting.healthreport.documentServerURI" = "http://127.0.0.1/";
70 | "healthreport.uploadEnabled" = false;
71 | "social.toast-notifications.enabled" = false;
72 |
73 | "browser.tabs.crashReporting.sendReport" = false;
74 | "breakpad.reportURL" = "";
75 |
76 | # Make sure updater telemetry is disabled; see .
77 | "toolkit.telemetry.updatePing.enabled" = false;
78 |
79 | # Do not tell what plugins we have enabled: https://mail.mozilla.org/pipermail/firefox-dev/2013-November/001186.html
80 | "plugins.enumerable_names" = "";
81 | "plugin.state.flash" = 0;
82 | "browser.search.update" = false;
83 |
84 | # Disable sensors
85 | "dom.battery.enabled" = false;
86 | "device.sensors.enabled" = false;
87 | "camera.control.face_detection.enabled" = false;
88 | "camera.control.autofocus_moving_callback.enabled" = false;
89 | "network.http.speculative-parallel-limit" = 0;
90 | "browser.urlbar.speculativeConnect.enabled" = false;
91 |
92 | # Don't download ads for the newtab page
93 | "browser.newtabpage.directory.source" = "";
94 | "browser.newtabpage.directory.ping" = "";
95 | "browser.newtabpage.introShown" = true;
96 |
97 | # Disable geolocation
98 | "geo.enabled" = false;
99 | "geo.wifi.uri" = "";
100 | "browser.search.geoip.url" = "";
101 | "browser.search.geoSpecificDefaults" = false;
102 | "browser.search.geoSpecificDefaults.url" = "";
103 | "browser.search.modernConfig" = false;
104 |
105 | # Don't report TLS errors to Mozilla
106 | "security.ssl.errorReporting.enabled" = false;
107 |
108 | # Disable Pocket integration
109 | "browser.pocket.enabled" = false;
110 | "extensions.pocket.enabled" = false;
111 |
112 | # Disable More from Mozilla
113 | "browser.preferences.moreFromMozilla" = false;
114 |
115 | # Do not show unicode urls https://www.xudongz.com/blog/2017/idn-phishing/
116 | "network.IDN_show_punycode" = true;
117 |
118 | # Disable screenshots extension
119 | "extensions.screenshots.disabled" = true;
120 |
121 | # Disable onboarding
122 | "browser.onboarding.newtour" = "performance,private,addons,customize,default";
123 | "browser.onboarding.updatetour" = "performance,library,singlesearch,customize";
124 | "browser.onboarding.enabled" = false;
125 |
126 | # Disable recommended extensions
127 | "extensions.htmlaboutaddons.discover.enabled" = false;
128 | "extensions.htmlaboutaddons.recommendations.enabled" = false;
129 |
130 | # Disable use of WiFi region/location information
131 | "browser.region.network.scan" = false;
132 | "browser.region.network.url" = "";
133 | "browser.region.update.enabled" = false;
134 |
135 | # Disable VPN/mobile promos
136 | "browser.contentblocking.report.hide_vpn_banner" = true;
137 | "browser.contentblocking.report.mobile-ios.url" = "";
138 | "browser.contentblocking.report.mobile-android.url" = "";
139 | "browser.contentblocking.report.show_mobile_app" = false;
140 | "browser.contentblocking.report.vpn.enabled" = false;
141 | "browser.contentblocking.report.vpn.url" = "";
142 | "browser.contentblocking.report.vpn-promo.url" = "";
143 | "browser.contentblocking.report.vpn-android.url" = "";
144 | "browser.contentblocking.report.vpn-ios.url" = "";
145 | "browser.privatebrowsing.promoEnabled" = false;
146 | };
147 |
148 | bookmarks = [
149 | {
150 | name = "Nix sites";
151 | toolbar = false;
152 | bookmarks = [
153 | {
154 | name = "nix.dev";
155 | url = "https://nix.dev/";
156 | }
157 | {
158 | name = "discourse";
159 | url = "https://discourse.nixos.org";
160 | }
161 | {
162 | name = "Noogle (nix func search)";
163 | url = "https://noogle.dev";
164 | }
165 | ];
166 | }
167 |
168 | {
169 | name = "Preact";
170 | toolbar = false;
171 | bookmarks = [
172 | {
173 | name = "GitHub";
174 | url = "https://github.com/preactjs/preact";
175 | }
176 | {
177 | name = "Tutorial";
178 | url = "https://preactjs.com/tutorial";
179 | }
180 | ];
181 | }
182 |
183 | {
184 | name = "Other";
185 | toolbar = false;
186 | bookmarks = [
187 | {
188 | name = "Xe";
189 | url = "https://xeiaso.net";
190 | }
191 | {
192 | name = "Faster than lime";
193 | url = "https://fasterthanli.me";
194 | }
195 | ];
196 | }
197 |
198 | {
199 | name = "Image utilities";
200 | toolbar = false;
201 | bookmarks = [
202 | {
203 | name = "CloudConvert";
204 | url = "https://cloudconvert.com";
205 | }
206 | {
207 | name = "Upscale Media";
208 | url = "https://upscale.media";
209 | }
210 | ];
211 | }
212 | {
213 | name = "🏴";
214 | toolbar = false;
215 | bookmarks = [
216 | {
217 | name = "Animeflix";
218 | url = "https://animeflix.live";
219 | }
220 | {
221 | name = "HiAnime";
222 | url = "https://hianime.to";
223 | }
224 | {
225 | name = "Anilab";
226 | url = "https://anilab.to";
227 | }
228 | {
229 | name = "Anitaku";
230 | url = "https://anitaku.so";
231 | }
232 | {
233 | name = "Gogoanime";
234 | url = "https://gogotaku.info/";
235 | }
236 | ];
237 | }
238 | ];
239 | };
240 | };
241 | }
242 |
--------------------------------------------------------------------------------
/home/git.nix:
--------------------------------------------------------------------------------
1 | # Fetch the user's Git email & username from home/options.nix
2 | let
3 | inherit (import ./options.nix) gitUserName gitEmail;
4 | in {
5 | programs.git = {
6 | enable = true;
7 | userName = "${gitUserName}";
8 | userEmail = "${gitEmail}";
9 | extraConfig = {
10 | init.defaultBranch = "main";
11 | color.ui = true;
12 | credential.helper = "store";
13 | github.user = gitUserName;
14 | push.autoSetupRemote = true;
15 | help.autocorrect = 10;
16 | };
17 |
18 | # Files/Dirs that should not be tracked by Git.
19 | # This is nice because you won't have to manually add them to a .gitignore file. In some cases, like this dotfiles repo, you
20 | # wont need to create the .gitignore file at all, keeping things clean and simple.
21 | # They will be written to Git's config directory at: ~/.config/git/ignore
22 | ignores = [
23 | "target/"
24 | ".cache/"
25 | ".idea/"
26 | "*.elc"
27 | ".~lock*"
28 | "auto-save-list"
29 | "result"
30 | "result-*"
31 |
32 | # Web dev stuff
33 | "node_modules/"
34 |
35 | # Direnv stuff
36 | ".envrc"
37 | ".direnv/"
38 |
39 | # My TO-DO list
40 | ".TODO.md"
41 | ];
42 | };
43 | }
44 |
--------------------------------------------------------------------------------
/home/gtk.nix:
--------------------------------------------------------------------------------
1 | {pkgs, ...}: rec {
2 | gtk = {
3 | enable = true;
4 | theme = {
5 | name = "Catppuccin-Mocha-Standard-Pink-Dark";
6 | package = pkgs.catppuccin-gtk.override {
7 | accents = ["pink"];
8 | size = "standard";
9 | variant = "mocha";
10 | };
11 | };
12 | cursorTheme.name = "default";
13 | iconTheme = {
14 | package = pkgs.catppuccin-papirus-folders.override {
15 | flavor = "mocha";
16 | accent = "pink";
17 | };
18 | name = "Papirus-Dark";
19 | };
20 | };
21 |
22 | # Symlink the `~/.config/gtk-4.0/` folder declaratively to theme GTK-4 apps as well.
23 | xdg.configFile = let
24 | g = gtk.theme.package;
25 | in {
26 | "gtk-4.0/assets".source = "${g}/share/themes/${g}/gtk-4.0/assets";
27 | "gtk-4.0/gtk.css".source = "${g}/share/themes/${g}/gtk-4.0/gtk.css";
28 | "gtk-4.0/gtk-dark.css".source = "${g}/share/themes/${g}/gtk-4.0/gtk-dark.css";
29 | };
30 | }
31 |
--------------------------------------------------------------------------------
/home/home.nix:
--------------------------------------------------------------------------------
1 | {inputs, ...}:
2 | # Fetches the user's name from home/options.nix
3 | # And then fetches the system's stateVersion from system/options.nix
4 | # HM's stateVersion should be in sync with the system's stateVersion to avoid mismatches and conflicts.
5 | let
6 | inherit (import ./options.nix) userName;
7 | inherit (import ../system/options.nix) stateVersion;
8 | in {
9 | imports = [
10 | ./cli.nix
11 | ./files.nix
12 | ./firefox.nix
13 | ./git.nix
14 | ./gtk.nix
15 | ./izrss.nix
16 | ./nushell.nix
17 | ./nix-settings.nix
18 | ./starship.nix
19 | ./tools.nix
20 | ./xdg.nix
21 | inputs.catppuccin.homeManagerModules.catppuccin
22 | inputs.izrss.homeManagerModules.default
23 | ];
24 |
25 | # Info required by home-manager and some session variables.
26 | home = {
27 | username = "${userName}";
28 | homeDirectory = "/home/${userName}";
29 | stateVersion = "${stateVersion}";
30 | };
31 |
32 | news.display = "silent";
33 | catppuccin.flavour = "mocha";
34 | programs.home-manager.enable = true;
35 | }
36 |
--------------------------------------------------------------------------------
/home/izrss.nix:
--------------------------------------------------------------------------------
1 | {
2 | programs.izrss = {
3 | enable = true;
4 | urls = [
5 | "https://isabelroses.com/rss.xml"
6 | "https://uncenter.dev/feed.xml"
7 | "https://nixpkgs.news/rss.xml"
8 | "https://fasterthanli.me/index.xml"
9 | ];
10 | };
11 | }
12 |
--------------------------------------------------------------------------------
/home/nix-settings.nix:
--------------------------------------------------------------------------------
1 | {
2 | inputs,
3 | lib,
4 | pkgs,
5 | ...
6 | }:
7 | # Fetch the userName from our home/options.nix file. It will be used to add the user to Nix's "trusted-users" so that we can
8 | # have additional rights when interacting with the Nix daemon.
9 | {
10 | nix = {
11 | # Keep build-time dependencies around to be able to rebuild while being offline.
12 | extraOptions = ''
13 | keep-outputs = true
14 | keep-derivations = true
15 | '';
16 | # Pin the registry to avoid downloading and evaling a new nixpkgs version every time.
17 | # I can not verify whether this works as intended.
18 | registry = lib.mapAttrs (_: v: {flake = v;}) inputs;
19 | settings = {
20 | auto-optimise-store = true;
21 | extra-substituters = ["https://hyprland.cachix.org"];
22 | extra-trusted-public-keys = [
23 | "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
24 | ];
25 | };
26 | package = pkgs.nix;
27 |
28 | # Enable auto cleanup.
29 | # 0fie used Arch for so long, they don't believe in rollbacks. We only roll forward!
30 | gc = {
31 | automatic = true;
32 | frequency = "daily";
33 | options = "--delete-older-than 1d";
34 | };
35 | };
36 |
37 | nixpkgs.config.allowUnfree = true;
38 | }
39 |
--------------------------------------------------------------------------------
/home/nushell.nix:
--------------------------------------------------------------------------------
1 | {
2 | pkgs,
3 | lib,
4 | ...
5 | }: let
6 | inherit (import ./options.nix) dotfilesDir userName;
7 | in {
8 | programs = {
9 | direnv = {
10 | enable = true;
11 | enableNushellIntegration = true;
12 | nix-direnv.enable = true;
13 | };
14 |
15 | nushell = {
16 | enable = true;
17 | shellAliases = let
18 | g = lib.getExe pkgs.git;
19 | c = "cargo";
20 | in {
21 | # Cargo
22 | cb = "${c} build";
23 | cc = "${c} check";
24 | cn = "${c} new";
25 | cr = "${c} run";
26 | cs = "${c} search";
27 | ct = "${c} test";
28 |
29 | # Git
30 | ga = "${g} add";
31 | gc = "${g} commit";
32 | gd = "${g} diff";
33 | gl = "${g} log";
34 | gs = "${g} status";
35 | gp = "${g} push origin main";
36 |
37 | # ETC.
38 | c = "clear";
39 | f = "${pkgs.yazi-unwrapped}/bin/yazi";
40 | la = "ls -la";
41 | ll = "ls -l";
42 | n = "${pkgs.nitch}/bin/nitch";
43 | nv = "nvim";
44 |
45 | # Nix
46 | ns = "sudo sh -c 'nixos-rebuild switch --flake ${dotfilesDir}/.# |& ${pkgs.nix-output-monitor}/bin/nom'";
47 | hs = "home-manager switch --flake ${dotfilesDir}";
48 | nd = "nix develop -c $env.SHELL";
49 | nlu = "nix flake lock --update-input";
50 |
51 | # Modern yuunix, uwu <3
52 | cat = "${pkgs.bat}/bin/bat";
53 | df = "${pkgs.duf}/bin/duf";
54 | find = "${pkgs.fd}/bin/fd";
55 | grep = "${pkgs.ripgrep}/bin/rg";
56 | tree = "${pkgs.eza}/bin/eza --git --icons --tree";
57 | };
58 |
59 | environmentVariables = {
60 | PROMPT_INDICATOR_VI_INSERT = ''" "'';
61 | PROMPT_INDICATOR_VI_NORMAL = ''"∙ "'';
62 | PROMPT_COMMAND = ''""'';
63 | PROMPT_COMMAND_RIGHT = ''""'';
64 | DIRENV_LOG_FORMAT = ''""''; # make direnv quiet
65 | SHELL = ''"${pkgs.nushell}/bin/nu"'';
66 | EDITOR = ''"nvim"'';
67 | };
68 |
69 | # See the Nushell docs for more options.
70 | extraConfig = let
71 | conf = builtins.toJSON {
72 | show_banner = false;
73 | edit_mode = "vi";
74 | shell_integration = true;
75 |
76 | ls.clickable_links = true;
77 | rm.always_trash = true;
78 |
79 | table = {
80 | mode = "rounded";
81 | index_mode = "always";
82 | header_on_separator = false;
83 | };
84 |
85 | cursor_shape = {
86 | vi_insert = "line";
87 | vi_normal = "block";
88 | };
89 |
90 | menus = [
91 | {
92 | name = "completion_menu";
93 | only_buffer_difference = false;
94 | marker = "? ";
95 | type = {
96 | layout = "columnar"; # list, description
97 | columns = 4;
98 | col_padding = 2;
99 | };
100 | style = {
101 | text = "magenta";
102 | selected_text = "blue_reverse";
103 | description_text = "yellow";
104 | };
105 | }
106 | ];
107 | };
108 | completion = name: ''
109 | source ${pkgs.nu_scripts}/share/nu_scripts/custom-completions/${name}/${name}-completions.nu
110 | '';
111 | completions = names:
112 | builtins.foldl' (prev: str: ''
113 | ${prev}
114 | ${str}'') "" (map completion names);
115 | in ''
116 | $env.config = ${conf};
117 | ${completions ["git" "nix" "man" "cargo"]}
118 |
119 | def --env ff [...args] {
120 | let tmp = (mktemp -t "yazi-cwd.XXXXX")
121 | yazi ...$args --cwd-file $tmp
122 | let cwd = (open $tmp)
123 | if $cwd != "" and $cwd != $env.PWD {
124 | cd $cwd
125 | }
126 | rm -fp $tmp
127 | }
128 |
129 | source /home/${userName}/.config/nushell/extra.nu
130 | '';
131 | };
132 | };
133 | }
134 |
--------------------------------------------------------------------------------
/home/options.nix:
--------------------------------------------------------------------------------
1 | rec {
2 | # Welcome to the user's control center.
3 | # This file contains variables that will be used to configure the user's home environment, such as the username.
4 | # If you're attempting to install this entire home-manager configuration on your machine, make sure to edit this file first.
5 | # Also check out system/options.nix for other options such as fonts. In future, such options will be moved from system to home-manager
6 | # for convinience.
7 |
8 | ##########################################
9 | # Below is the username for your user. Do not include special characters.
10 | # Suppose you're called Tom, you'd edit the line like so:
11 | #
12 | #...
13 | # userName = "tom";
14 | #...
15 | #
16 | # Your home directory will then be /home/tom
17 | # Required by home/firefox.nix (for setting up user profile) and system/users.nix (to add the user to the system)
18 | userName = "0fie";
19 |
20 | ###########################################
21 | # The user's full name. Can be anything.
22 | # Here's how Mr. Tux does it:
23 | #
24 | #...
25 | # userFullName = "Mr. Tux";
26 | #...
27 | #
28 | # Required by home/firefox.nix (for setting up user profile)
29 | userFullName = "0fie";
30 |
31 | ##########################################
32 | # Your GitHub user name
33 | # Required by home/git.nix
34 | gitUserName = "0fie";
35 |
36 | ##########################################
37 | # Your git email.
38 | # Make sure it is correct and verified by GitHub (you should be able to login using the email)... otherwise your contributions
39 | # will not be recognised or displayed on your GitHub profile's 'contributions' section.
40 | # Required by home/git.nix
41 | gitEmail = "151028199+0fie@users.noreply.github.com";
42 |
43 | ##########################################
44 | # The variable below defines where these dotfiles are located on your machine. It is used by the 'hs' and 'ns' aliases in home/nushell.nix
45 | # Change it to the actual absolute path of these dotfiles. If they are in your Downloads folder, you'd edit the line like so:
46 | #
47 | #...
48 | # dotfilesDir = "home/username/Downloads/Maika";
49 | #...
50 | #
51 | # Required by home/nushell.nix
52 | dotfilesDir = "/home/${userName}/Projects/Maika";
53 | }
54 |
--------------------------------------------------------------------------------
/home/starship.nix:
--------------------------------------------------------------------------------
1 | {
2 | programs.starship = {
3 | enable = true;
4 | catppuccin.enable = true;
5 | enableNushellIntegration = true;
6 |
7 | settings = {
8 | right_format = "$cmd_duration";
9 |
10 | directory = {
11 | format = "[ ](bold #89b4fa)[ $path ]($style)";
12 | style = "bold #b4befe";
13 | };
14 |
15 | character = {
16 | success_symbol = "[ ](bold #89b4fa)[ ➜](bold green)";
17 | error_symbol = "[ ](bold #89b4fa)[ ➜](bold red)";
18 | };
19 |
20 | cmd_duration = {
21 | min_time = 10;
22 | format = "[]($style)[[ ](bg:#161821 fg:#d4c097 bold)$duration](bg:#161821 fg:#BBC3DF)[ ]($style)";
23 | disabled = false;
24 | style = "bg:none fg:#161821";
25 | };
26 |
27 | directory.substitutions = {
28 | "~" = "";
29 | "Documents" = " ";
30 | "Downloads" = " ";
31 | "Music" = " ";
32 | "Pictures" = " ";
33 | };
34 | };
35 | };
36 | }
37 |
--------------------------------------------------------------------------------
/home/tools.nix:
--------------------------------------------------------------------------------
1 | {pkgs, ...}: {
2 | # Additional packages that should be installed to the user profile.
3 | home.packages = with pkgs; [
4 | charm-freeze
5 | exercism
6 | git-extras # Provides useful commands like git-summary
7 | haruna
8 | jetbrains-toolbox
9 | keepassxc
10 | nix-inspect # Interactive TUI for inspecting nix configs.
11 | nix-prefetch-scripts # utils for getting sha256 of URLs and git repos
12 | protonvpn-gui # at least it's open source
13 | rustup
14 | spotify
15 | vesktop
16 | vscode
17 | ];
18 | }
19 |
--------------------------------------------------------------------------------
/home/xdg.nix:
--------------------------------------------------------------------------------
1 | {
2 | config,
3 | pkgs,
4 | ...
5 | }: let
6 | browser = "firefox.desktop";
7 | fileManager = "org.gnome.Nautilus.desktop";
8 | imageViewer = "org.gnome.Loupe.desktop";
9 | mediaPlayer = "haruna.desktop";
10 | textEditor = "neovim.desktop";
11 | in {
12 | xdg = {
13 | enable = true;
14 | portal = with pkgs; {
15 | enable = true;
16 | configPackages = [xdg-desktop-portal-gtk xdg-desktop-portal-hyprland xdg-desktop-portal];
17 | extraPortals = [xdg-desktop-portal-gtk xdg-desktop-portal];
18 | xdgOpenUsePortal = true;
19 | };
20 | userDirs = {
21 | enable = true;
22 | createDirectories = true;
23 | desktop = "${config.home.homeDirectory}/Projects";
24 | publicShare = "${config.home.homeDirectory}/.local/public";
25 | templates = "${config.home.homeDirectory}/.local/templates";
26 | };
27 |
28 | # TODO: use 'map' to avoid unnecessary repetition.
29 | mimeApps = let
30 | br = browser;
31 | fm = fileManager;
32 | iv = imageViewer;
33 | mp = mediaPlayer;
34 | te = textEditor;
35 | in rec {
36 | enable = true;
37 | associations.added = defaultApplications;
38 | defaultApplications = {
39 | # Office documents.
40 | "application/pdf" = br;
41 |
42 | "inode/directory" = fm;
43 |
44 | # Web stuff.
45 | "application/xhtml+xml" = br;
46 | "text/html" = br;
47 | "x-scheme-handler/http" = br;
48 | "x-scheme-handler/https" = br;
49 |
50 | # Images.
51 | "image/avif" = iv;
52 | "image/gif" = iv;
53 | "image/jpeg" = iv;
54 | "image/jpg" = iv;
55 | "image/pjpeg" = iv;
56 | "image/png" = iv;
57 | "image/tiff" = iv;
58 | "image/webp" = iv;
59 | "image/x-bmp" = iv;
60 | "image/x-gray" = iv;
61 | "image/x-icb" = iv;
62 | "image/x-ico" = iv;
63 | "image/x-png" = iv;
64 |
65 | # Plain text & code.
66 | "application/x-shellscript" = te;
67 | "text/plain" = te;
68 |
69 | # Videos.
70 | "video/mkv" = mp;
71 | "video/mp4" = mp;
72 | "video/webm" = mp;
73 | };
74 | };
75 | };
76 | }
77 |
--------------------------------------------------------------------------------
/system/boot.nix:
--------------------------------------------------------------------------------
1 | {
2 | boot = {
3 | loader.grub = {
4 | enable = true;
5 | device = "/dev/sda";
6 | timeoutStyle = "hidden";
7 | catppuccin.enable = true;
8 | };
9 |
10 | kernel.sysctl = {
11 | # Do not try to use swap space unless absolutely necessary.
12 | "vm.swappiness" = 0;
13 |
14 | # Speed up the initial connection establishment process in TCP connections.
15 | "net.ipv4.tcp_fastopen" = 3;
16 |
17 | # TCP congestion control.
18 | "net.ipv4.tcp_congestion_control" = "bbr";
19 | "net.core.default_qdisc" = "cake";
20 | };
21 |
22 | # TCP congestion control.
23 | kernelModules = ["tcp_bbr"];
24 | };
25 | }
26 |
--------------------------------------------------------------------------------
/system/configuration.nix:
--------------------------------------------------------------------------------
1 | {inputs, ...}:
2 | # Fetches the stateVersion variable from our system's options.nix file.
3 | let
4 | inherit (import ./options.nix) stateVersion;
5 | in {
6 | imports = [
7 | ./boot.nix
8 | ./desktop.nix
9 | ./environment.nix
10 | ./fonts.nix
11 | ./hardware-configuration.nix
12 | ./locale.nix
13 | ./networking.nix
14 | ./nix-settings.nix
15 | ./services.nix
16 | ./sound.nix
17 | ./sys.nix
18 | ./users.nix
19 | inputs.catppuccin.nixosModules.catppuccin
20 | ];
21 |
22 | system.stateVersion = "${stateVersion}";
23 | }
24 |
--------------------------------------------------------------------------------
/system/desktop.nix:
--------------------------------------------------------------------------------
1 | {pkgs, ...}: {
2 | services = {
3 | desktopManager.plasma6.enable = true;
4 | displayManager.sddm = {
5 | enable = true;
6 | wayland = {
7 | enable = true;
8 | compositor = "kwin";
9 | };
10 | };
11 | };
12 | environment.plasma6.excludePackages = with pkgs.kdePackages; [kate dolphin elisa kwallet];
13 | }
14 |
--------------------------------------------------------------------------------
/system/environment.nix:
--------------------------------------------------------------------------------
1 | {pkgs, ...}: {
2 | environment = {
3 | # Packages to be installed into the system profile. Every user including root will have these packages.
4 | # ntfs3g allows us to mount external drives that use NTFS.
5 | systemPackages = with pkgs; [ntfs3g];
6 | };
7 | }
8 |
--------------------------------------------------------------------------------
/system/fonts.nix:
--------------------------------------------------------------------------------
1 | # If you'd like to change the font, see system/options.nix
2 | # There's nothing much to edit here.
3 | # We will use this to set the default font system-wide.
4 | let
5 | inherit (import ./options.nix) fontName;
6 | in {
7 | fonts = {
8 | enableDefaultPackages = true;
9 | fontconfig.defaultFonts = rec {
10 | monospace = ["${fontName} Mono"];
11 | sansSerif = ["${fontName}"];
12 | serif = sansSerif;
13 | };
14 | };
15 | }
16 |
--------------------------------------------------------------------------------
/system/hardware-configuration.nix:
--------------------------------------------------------------------------------
1 | # ###############################################
2 | #
3 | # WARNING: This hardware configuration is almost certainly not suitable for your machine.
4 | # You can generate your own HW config by overriding the contents of this file, like so:
5 | #...
6 | # nixos-generate-config --show-hardware-config > system/hardware-configuration.nix
7 | #...
8 | #
9 | # To copy & paste the command above as is, without modification, you'd need to be in the Maika directory (or the root of wherever you cloned this repo into),
10 | # or '../' (from this file).
11 | # Do not modify this file! It was generated by ‘nixos-generate-config’
12 | # and may be overwritten by future invocations. Please make changes
13 | # to /etc/nixos/configuration.nix instead.
14 | {
15 | config,
16 | lib,
17 | modulesPath,
18 | ...
19 | }: {
20 | imports = [(modulesPath + "/installer/scan/not-detected.nix")];
21 | boot = {
22 | initrd.availableKernelModules = ["ehci_pci" "ahci" "xhci_pci" "ums_realtek" "sd_mod" "sr_mod"];
23 | initrd.kernelModules = [];
24 | kernelModules = ["kvm-intel"];
25 | extraModulePackages = [];
26 | };
27 |
28 | # tmpfs for /tmp is safely declared in system/sys.nix
29 | fileSystems."/" = {
30 | device = "/dev/sda1";
31 | fsType = "ext4";
32 | };
33 |
34 | swapDevices = [];
35 |
36 | # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
37 | # (the default) this is the recommended approach. When using systemd-networkd it's
38 | # still possible to use this option, but it's recommended to use it in conjunction
39 | # with explicit per-interface declarations with `networking.interfaces..useDHCP`.
40 | networking.useDHCP = lib.mkDefault true;
41 | # networking.interfaces.enp5s0.useDHCP = lib.mkDefault true;
42 | # networking.interfaces.wlp9s0.useDHCP = lib.mkDefault true;
43 |
44 | nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
45 | hardware.cpu.intel.updateMicrocode =
46 | lib.mkDefault config.hardware.enableRedistributableFirmware;
47 | }
48 |
--------------------------------------------------------------------------------
/system/locale.nix:
--------------------------------------------------------------------------------
1 | # There is nothing meaningful to edit here. See system/options.nix
2 | # Time zone and locale are fetched from system/options.nix
3 | let
4 | inherit (import ./options.nix) theTimezone theLocale;
5 | in {
6 | i18n = {
7 | defaultLocale = "${theLocale}";
8 | extraLocaleSettings = {
9 | LC_ADDRESS = "${theLocale}";
10 | LC_IDENTIFICATION = "${theLocale}";
11 | LC_MEASUREMENT = "${theLocale}";
12 | LC_MONETARY = "${theLocale}";
13 | LC_NAME = "${theLocale}";
14 | LC_NUMERIC = "${theLocale}";
15 | LC_PAPER = "${theLocale}";
16 | LC_TELEPHONE = "${theLocale}";
17 | LC_TIME = "${theLocale}";
18 | };
19 | };
20 |
21 | time = {
22 | timeZone = "${theTimezone}";
23 | hardwareClockInLocalTime = true;
24 | };
25 | }
26 |
--------------------------------------------------------------------------------
/system/networking.nix:
--------------------------------------------------------------------------------
1 | # Fetches the hostName from our system/options.nix file.
2 | let
3 | inherit (import ./options.nix) hostName;
4 | in {
5 | networking = {
6 | networkmanager.enable = true;
7 | hostName = "${hostName}";
8 | firewall = {
9 | enable = true;
10 | # The ports below are needed by Spotify.
11 | allowedTCPPorts = [4381];
12 | allowedUDPPorts = [4381];
13 | };
14 | };
15 | }
16 |
--------------------------------------------------------------------------------
/system/nix-settings.nix:
--------------------------------------------------------------------------------
1 | {
2 | inputs,
3 | lib,
4 | ...
5 | }:
6 | # Fetch the userName from our home/options.nix file. It will be used to add the user to Nix's "trusted-users" so that we can
7 | # have additional rights when interacting with the Nix daemon.
8 | let
9 | inherit (import ../home/options.nix) userName;
10 | in {
11 | nix = {
12 | # Keep build-time dependencies around to be able to rebuild while being offline.
13 | extraOptions = ''
14 | keep-outputs = true
15 | keep-derivations = true
16 | '';
17 | # Pin the registry to avoid downloading and evaling a new nixpkgs version every time.
18 | # I can not verify whether this works as intended.
19 | registry = lib.mapAttrs (_: v: {flake = v;}) inputs;
20 |
21 | settings = {
22 | auto-optimise-store = true;
23 | trusted-users = ["${userName}"];
24 | experimental-features = ["nix-command" "flakes"];
25 | };
26 |
27 | # Enable auto cleanup.
28 | # 0fie used Arch for so long, they don't believe in rollbacks. We only roll forward!
29 | gc = {
30 | automatic = true;
31 | persistent = true;
32 | dates = "daily";
33 | options = "--delete-older-than 1d";
34 | };
35 | };
36 |
37 | nixpkgs.config.allowUnfree = true;
38 | }
39 |
--------------------------------------------------------------------------------
/system/options.nix:
--------------------------------------------------------------------------------
1 | {
2 | # Welcome to the system control center.
3 | #
4 | # This file defines a bunch of options to be used on the NixOS system, such as the default fonts, time zone, etc.
5 | # If you find yourself editing this file, then you're probably planning to install my entire NixOS configuration. I don't
6 | # recommend this. Also see system/boot.nix and system/sys.nix
7 | # Also inspect home/options.nix for user options.
8 |
9 | ####################################################
10 | # You may wish to change the system's hostname. This can be achieved by editing the line below. Suppose you want to set
11 | # the hostname to 'Hyprnix', you'd edit the line like so:
12 | # ...
13 | # hostName = "Hyprnix";
14 | # ...
15 | #
16 | # Required by system/networking.nix
17 | hostName = "NixOS";
18 |
19 | ####################################################
20 | # The variable below defines the locale to be used on the computer. It is used by apps to determine language settings,
21 | # sort orders, currency formats, etc. Suppose you're based in the Netherlands, you'd change the locale like so:
22 | # ...
23 | # theLocale = "nl_NL.UTF-8";
24 | # ...
25 | #
26 | # If you set the wrong locale, apps like the browser might display dates and currency in "incorrect formats".
27 | # Required by system/locale.nix
28 | theLocale = "en_ZW.UTF-8";
29 |
30 | ####################################################
31 | # You almost certainly want to edit the line below. It defines the time zone used when displaying times and dates. Suppose
32 | # you're based in New York, USA, you'd edit the line below like so:
33 | #
34 | # ...
35 | # theTimezone = "America/New_York";
36 | # ...
37 | #
38 | # See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for a list of possible values.
39 | # Required by system/locale.nix
40 | theTimezone = "Africa/Harare";
41 |
42 | ####################################################
43 | # The variable below is used by the flake to determine the system architecture. By default, it's for 64-bit Intel/AMD Linux.
44 | # Suppose you're on 64-bit Intel macOS, you'd edit the line below like so:
45 | #
46 | #...
47 | # system = "x86_64-darwin";
48 | #...
49 | #
50 | # However, I can not guarantee that the rest of this NixOS configuration will function properly in that case. It will not.
51 | # Required by flake.nix
52 | system = "x86_64-linux";
53 |
54 | ####################################################
55 | # The 'fontName' variable below is used by apps like Waybar and Kitty to determine which font to use. It is *not* the actual font
56 | # package that will get installed. Suppose you've installed the Iosevka font and would like all your apps to use it, you'd edit the
57 | # line below like so:
58 | #
59 | # ...
60 | # fontName = "Iosevka Nerd Font";
61 | # ...
62 | #
63 | #
64 | # NOTE:
65 | # - You should install the font yourself, manually. This variable just exists to let your apps know which font to use.
66 | # - Don't add 'Mono' in front of the fontName... otherwise icons will appear 'too small' in Kitty.
67 | # Required by system/fonts.nix
68 | fontName = "MonoLisa Nerd Font";
69 |
70 | #####################################################
71 | # Do not modify the variable below.
72 | # We're using it to make sure that home-manager's stateVersion is in sync with the system's stateVersion.
73 | stateVersion = "23.11";
74 | }
75 |
--------------------------------------------------------------------------------
/system/services.nix:
--------------------------------------------------------------------------------
1 | {
2 | services = {
3 | # Trim SSD in the background, once every week.
4 | fstrim = {
5 | enable = true;
6 | interval = "weekly";
7 | };
8 |
9 | # I'm on a laptop. Adjust this to your liking.
10 | logind = {
11 | lidSwitch = "suspend";
12 | powerKey = "suspend";
13 | powerKeyLongPress = "reboot";
14 | };
15 | };
16 | }
17 |
--------------------------------------------------------------------------------
/system/sound.nix:
--------------------------------------------------------------------------------
1 | {
2 | # Enable sound with Pipewire.
3 | sound.enable = true;
4 | hardware.pulseaudio.enable = false;
5 | security.rtkit.enable = true;
6 | services.pipewire = {
7 | enable = true;
8 | alsa.enable = true;
9 | pulse.enable = true;
10 | };
11 | }
12 |
--------------------------------------------------------------------------------
/system/sys.nix:
--------------------------------------------------------------------------------
1 | # In this file, we have hardware acceleration and tmpfs for /tmp
2 | {
3 | hardware.enableRedistributableFirmware = true;
4 |
5 | # Laptop's fan go brrrr.
6 | powerManagement = {
7 | enable = true;
8 | cpuFreqGovernor = "performance";
9 | };
10 |
11 | # tmpfs on /tmp for speed and less strain on SSD/HDD during builds.
12 | fileSystems."/tmp" = {
13 | device = "none";
14 | fsType = "tmpfs";
15 | options = ["defaults" "size=30%" "mode=755"];
16 | };
17 | }
18 |
--------------------------------------------------------------------------------
/system/users.nix:
--------------------------------------------------------------------------------
1 | {pkgs, ...}:
2 | # Fetch the user's name and full name from home/options.nix
3 | let
4 | inherit (import ../home/options.nix) userName userFullName;
5 | in {
6 | # You can change the user name by editing home/options.nix
7 | users = {
8 | mutableUsers = true;
9 | users.${userName} = {
10 | isNormalUser = true;
11 | description = "${userFullName}";
12 | extraGroups = ["networkmanager" "wheel"];
13 | hashedPassword = "$y$j9T$RESLq/fRruOfj/mdwU7MQ/$Hf7riy3m/QEwAmzxU8UBvU1NASKqshloGjhXripIlg6";
14 | shell = pkgs.nushell;
15 | };
16 | };
17 | }
18 |
--------------------------------------------------------------------------------