···33This repo contains the flake I use to configure any of my NixOS-configured
44devices.
5566-## Structure
66+## Current Configurations
7788-- flake.nix: Central file for exporting all my configs and anything else I need.
99-- lib.nix: Helper functions
1010-- systemconfigs/: All systems this flake configures, each system has some
1111- options that describe it but the main thing that determines what options they
1212- set are _roles_.
1313-- nixosModules/: A set of path-"routed" NixOS modules that represent "roles". A
1414- role is a feature a system can have (ex. the `graphics` role enables Hyprland,
1515- GUI apps, etc). Roles can either be a singular nix file, or a folder of them
1616- if they're complicated. Files named `role1+role2.nix` represent an _overlap_
1717- role, which is applied if all roles delimited by `+` are turned on.
1818-- base/: This folder contains modules applied unconditionally to all systems.
1919-- res/: Non-nix files used in the config. Pictures, scripts, etc.
2020-- pkgs/: Custom nix packages made for my config.
2121-- create-sys/: WIP tool for automating the creation of new systems. Currently
2222- just has an interactive prompt for adding a new `.nix` file to `systems/`.
2323-2424-## Implementation
2525-2626-I'm not going to lie, I have no idea what I'm doing. Is every feature here
2727-implmemented well? Definitely not, but that's okay!
88+- `aperture` - Framework 13 Laptop
99+- `black-mesa` - Desktop Computer w/ AMD GPU
1010+- `installer` - Installer/LiveCD ISO for my flake
···11-{lib, ...}: {
22- # /tmp should be clean!
33- boot.tmp.cleanOnBoot = true;
44-55- # Give me back my RAM!
66- services.logind.settings.Login.RuntimeDirectorySize = "100M";
77-}
-47
oldNixosModules/base/nix.nix
···11-{
22- pkgs,
33- inputs,
44- lib,
55- ...
66-}: {
77- environment.systemPackages = with pkgs; [
88- nh
99- nix-output-monitor
1010- ];
1111-1212- nix = {
1313- channel.enable = false;
1414- registry.p.flake = inputs.self;
1515- package = pkgs.lix;
1616- settings = {
1717- # So we can do `import <nixpkgs>`
1818- nix-path = "nixpkgs=${inputs.nixpkgs}";
1919- experimental-features = [
2020- "nix-command"
2121- "flakes"
2222- "pipe-operator"
2323- ];
2424- auto-optimise-store = true;
2525- fallback = true;
2626- };
2727- gc = {
2828- automatic = false;
2929- dates = "weekly";
3030- };
3131- };
3232-3333- # Switch ng is not as weird
3434- # system.switch = {
3535- # enable = false;
3636- # enableNg = true;
3737- # };
3838-3939- # Kill nix daemon builds over user sessions
4040- systemd.services.nix-daemon.serviceConfig.OOMScoreAdjust = lib.mkDefault 250;
4141-4242- # Keeps flake inputs when GCing
4343- system.extraDependencies = with builtins; let
4444- flakeDeps = flake: [flake.outPath] ++ (foldl' (a: b: a ++ b) [] (map flakeDeps (attrValues flake.inputs or {})));
4545- in
4646- flakeDeps inputs.self;
4747-}