From 1dd0a5e0cac04087dfcf49acdd8fc0c875d680b8 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Sun, 10 Dec 2023 23:48:46 +0100 Subject: [PATCH] Reorganize devshells --- README.md | 29 ++- common/default.nix | 4 + common/fonts.nix | 4 +- devshells/README.md | 14 ++ .../bootstrap/nixpkgs.nix | 2 +- shell.nix => devshells/bootstrap/shell.nix | 3 +- devshells/default.nix | 1 + flake.lock | 148 ++++--------- flake.nix | 208 +++++++----------- home/features/cli/default.nix | 1 - home/features/cli/eza.nix | 3 +- home/features/cli/git.nix | 12 +- home/features/cli/nix-index.nix | 5 + home/features/cli/starship.nix | 6 +- home/features/desktop/wakatime/default.nix | 2 +- home/features/neovim/default.nix | 5 +- home/global.nix | 48 ++-- home/tethys.nix | 7 +- hosts/nixos/common/global/{ => cli}/fish.nix | 0 hosts/nixos/common/global/cli/htop.nix | 8 + hosts/nixos/common/global/{ => cli}/sudo.nix | 0 hosts/nixos/common/global/default.nix | 37 +++- .../common/global/{ => services}/openssh.nix | 0 .../global/{ => services}/tailscale.nix | 0 .../common/optional/{ => desktop}/steam.nix | 0 .../optional/{ => desktop}/xdg-portal.nix | 0 .../common/optional/{ => services}/gitea.nix | 0 .../optional/{ => services}/slambda.nix | 0 .../optional/{ => services}/syncthing.nix | 0 .../optional/{ => wayland}/hyprland.nix | 2 +- .../common/optional/{ => xorg}/lightdm.nix | 0 .../common/optional/{ => xorg}/touchpad.nix | 0 .../common/optional/{ => xorg}/xmonad/Main.hs | 0 .../optional/{ => xorg}/xmonad/default.nix | 0 .../common/optional/{ => xorg}/xserver.nix | 0 hosts/nixos/euporie/default.nix | 6 +- hosts/nixos/lapetus/default.nix | 2 +- hosts/nixos/lapetus/services/syncthing.nix | 2 +- hosts/nixos/tethys/default.nix | 23 +- hosts/nixos/tethys/hardware/generated.nix | 2 +- hosts/nixos/tethys/services/syncthing.nix | 2 +- modules/common/lua-colorscheme.nix | 4 +- pkgs/plymouth-themes.nix | 2 +- pkgs/vimclip.nix | 4 +- 44 files changed, 269 insertions(+), 327 deletions(-) create mode 100644 devshells/README.md rename nixpkgs.nix => devshells/bootstrap/nixpkgs.nix (75%) rename shell.nix => devshells/bootstrap/shell.nix (71%) create mode 100644 home/features/cli/nix-index.nix rename hosts/nixos/common/global/{ => cli}/fish.nix (100%) create mode 100644 hosts/nixos/common/global/cli/htop.nix rename hosts/nixos/common/global/{ => cli}/sudo.nix (100%) rename hosts/nixos/common/global/{ => services}/openssh.nix (100%) rename hosts/nixos/common/global/{ => services}/tailscale.nix (100%) rename hosts/nixos/common/optional/{ => desktop}/steam.nix (100%) rename hosts/nixos/common/optional/{ => desktop}/xdg-portal.nix (100%) rename hosts/nixos/common/optional/{ => services}/gitea.nix (100%) rename hosts/nixos/common/optional/{ => services}/slambda.nix (100%) rename hosts/nixos/common/optional/{ => services}/syncthing.nix (100%) rename hosts/nixos/common/optional/{ => wayland}/hyprland.nix (84%) rename hosts/nixos/common/optional/{ => xorg}/lightdm.nix (100%) rename hosts/nixos/common/optional/{ => xorg}/touchpad.nix (100%) rename hosts/nixos/common/optional/{ => xorg}/xmonad/Main.hs (100%) rename hosts/nixos/common/optional/{ => xorg}/xmonad/default.nix (100%) rename hosts/nixos/common/optional/{ => xorg}/xserver.nix (100%) diff --git a/README.md b/README.md index 24057b8..438cd6a 100644 --- a/README.md +++ b/README.md @@ -22,21 +22,20 @@ This repo's structure is based on the concept of hosts - individual machines con ## File structure -| Location | Description | -| ---------------------------- | --------------------------------------------------- | -| [common](./common) | Configuration loaded on both nixos and home-manager | -| [devshells](./devshells) | Nix shells | -| [docs](./docs) | Additional documentation regarding my setup | -| [home](./home) | Home manager configurations | -| [hosts/nixos](./hosts/nixos) | Nixos configurations | -| [modules](./modules) | Custom generic/nixos/home-manager modules | -| [overlays](./overlays) | Nix overlays | -| [pkgs](./pkgs) | Nix packages | -| [flake.nix](./flake.nix) | Nix flake entrypoint! | -| [nixpkgs.nix](./nixpkgs.nix) | Pinned nixpkgs for bootstrapping | -| [secrets.nix](./secrets.nix) | Agenix entrypoint | -| [shell.nix](./shell.nix) | Bootstrapping nix shell | -| [stylua.toml](./stylua.toml) | Lua formatter config for the repo | +| Location | Description | +| ---------------------------- | ---------------------------------------------------- | +| [common](./common) | Configuration loaded on both nixos and home-manager | +| [devshells](./devshells) | Nix shells | +| [docs](./docs) | Additional documentation regarding my setup | +| [home](./home) | Home manager configurations | +| [hosts/nixos](./hosts/nixos) | Nixos configurations | +| [modules](./modules) | Custom generic/nixos/home-manager modules | +| [overlays](./overlays) | Nix overlays | +| [pkgs](./pkgs) | Nix packages | +| [flake.nix](./flake.nix) | Nix flake entrypoint! | +| [secrets.nix](./secrets.nix) | Agenix entrypoint | +| [bootstrap](./bootstrap) | Shell for bootstrapping on non flake-enabled systems | +| [stylua.toml](./stylua.toml) | Lua formatter config for the repo | ## Points of interest diff --git a/common/default.nix b/common/default.nix index e76a393..137a836 100644 --- a/common/default.nix +++ b/common/default.nix @@ -1,4 +1,8 @@ # This directory contains modules which can be loaded on both nixos and home-manager! { imports = [ ./fonts.nix ./themes ]; + + # {{{ ad-hoc toggles + satellite.toggles.neovim-nightly.enable = false; + # }}} } diff --git a/common/fonts.nix b/common/fonts.nix index 056e62a..4a42cbd 100644 --- a/common/fonts.nix +++ b/common/fonts.nix @@ -16,8 +16,8 @@ }; sizes = { - desktop = 14; - applications = 17; + desktop = 13; + applications = 15; }; }; } diff --git a/devshells/README.md b/devshells/README.md new file mode 100644 index 0000000..de327e6 --- /dev/null +++ b/devshells/README.md @@ -0,0 +1,14 @@ +# Devshells + +Nix shells accessible via `nix develop` (or the legacy `nix-shell`). My projects provide their own shells, but having a few generic ones is still useful for making quick contributions to external projects and the like. + +## File structure + +| Location | Description | +| ------------------------------ | ----------------------------------------------------------------------------- | +| [bootstrap](./bootstrap) | Shell for bootstrapping on non flake-enabled systems | +| [haskell](./haskell.nix) | Common haskell tooling | +| [purescript](./purescript.nix) | Common purescript tooling | +| [purescript](./lua.nix) | Common lua tooling | +| [purescript](./typst.nix) | Common lua typst | +| [rwtw](./rwtw.nix) | A few randomly cobbled together tools for working on the rain world tech wiki | diff --git a/nixpkgs.nix b/devshells/bootstrap/nixpkgs.nix similarity index 75% rename from nixpkgs.nix rename to devshells/bootstrap/nixpkgs.nix index 041de40..f062a4d 100644 --- a/nixpkgs.nix +++ b/devshells/bootstrap/nixpkgs.nix @@ -1,6 +1,6 @@ # A nixpkgs instance that is grabbed from the pinned nixpkgs commit in the lock file # This is useful to avoid using channels when using legacy nix commands -let lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked; +let lock = (builtins.fromJSON (builtins.readFile ../../flake.lock)).nodes.nixpkgs.locked; in import (fetchTarball { url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz"; diff --git a/shell.nix b/devshells/bootstrap/shell.nix similarity index 71% rename from shell.nix rename to devshells/bootstrap/shell.nix index 338e511..daff010 100644 --- a/shell.nix +++ b/devshells/bootstrap/shell.nix @@ -1,6 +1,5 @@ # Shell for bootstrapping flake-enabled nix and home-manager -# You can enter it through 'nix develop' or (legacy) 'nix-shell' -{ pkgs ? (import ./nixpkgs.nix) { } }: +{ pkgs ? (import ./nixpkgs.nix) { }, ... }: pkgs.mkShell { # Enable experimental features without having to specify the argument NIX_CONFIG = "experimental-features = nix-command flakes"; diff --git a/devshells/default.nix b/devshells/default.nix index f3e6733..53b815d 100644 --- a/devshells/default.nix +++ b/devshells/default.nix @@ -4,5 +4,6 @@ args: { rwtw = import ./rwtw.nix args; typst = import ./typst.nix args; lua = import ./lua.nix args; + bootstrap = import ./bootstrap/shell.nix args; } diff --git a/flake.lock b/flake.lock index 0af4393..142f063 100644 --- a/flake.lock +++ b/flake.lock @@ -456,28 +456,6 @@ "type": "github" } }, - "deploy-rs": { - "inputs": { - "flake-compat": "flake-compat", - "nixpkgs": [ - "nixpkgs" - ], - "utils": "utils" - }, - "locked": { - "lastModified": 1695052866, - "narHash": "sha256-agn7F9Oww4oU6nPiw+YiYI9Xb4vOOE73w8PAoBRP4AA=", - "owner": "serokell", - "repo": "deploy-rs", - "rev": "e3f41832680801d0ee9e2ed33eb63af398b090e9", - "type": "github" - }, - "original": { - "owner": "serokell", - "repo": "deploy-rs", - "type": "github" - } - }, "dirforest": { "flake": false, "locked": { @@ -602,22 +580,6 @@ } }, "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1668681692, - "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "009399224d5e398d03b22badca40a37ac85412a1", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_2": { "flake": false, "locked": { "lastModified": 1673956053, @@ -633,7 +595,7 @@ "type": "github" } }, - "flake-compat_3": { + "flake-compat_2": { "flake": false, "locked": { "lastModified": 1696426674, @@ -649,7 +611,7 @@ "type": "github" } }, - "flake-compat_4": { + "flake-compat_3": { "locked": { "lastModified": 1688025799, "narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=", @@ -664,6 +626,22 @@ "type": "github" } }, + "flake-compat_4": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-compat_5": { "flake": false, "locked": { @@ -728,22 +706,6 @@ "type": "github" } }, - "flake-compat_9": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -1849,7 +1811,7 @@ }, "neovim-nightly-overlay": { "inputs": { - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat_2", "flake-parts": "flake-parts_3", "hercules-ci-effects": "hercules-ci-effects", "neovim-flake": "neovim-flake", @@ -1914,6 +1876,26 @@ "type": "github" } }, + "nix-index-database": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1702177733, + "narHash": "sha256-lr3hkmmuqDFPj3i41cHpaALF3Txo3kxsJ3L6jZLujJ8=", + "owner": "Mic92", + "repo": "nix-index-database", + "rev": "58ecd98e27e27fcbb27a51a588555c828b1ec56e", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "nix-index-database", + "type": "github" + } + }, "nixd": { "inputs": { "flake-parts": "flake-parts_5", @@ -1933,26 +1915,6 @@ "type": "github" } }, - "nixinate": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1688141737, - "narHash": "sha256-qHrNMYWukOKmKVf6wXOGKj1xxUnOGjvTRbt/PLLXuBE=", - "owner": "matthewcroughan", - "repo": "nixinate", - "rev": "7902ae845e6cc5bd450e510cdf5e009a6e4a44d9", - "type": "github" - }, - "original": { - "owner": "matthewcroughan", - "repo": "nixinate", - "type": "github" - } - }, "nixos-hardware": { "locked": { "lastModified": 1701656485, @@ -2150,7 +2112,7 @@ }, "nixpkgs-wayland": { "inputs": { - "flake-compat": "flake-compat_4", + "flake-compat": "flake-compat_3", "lib-aggregate": "lib-aggregate", "nix-eval-jobs": "nix-eval-jobs", "nixpkgs": [ @@ -2474,7 +2436,7 @@ }, "pre-commit-hooks": { "inputs": { - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat", "flake-utils": "flake-utils_2", "gitignore": "gitignore", "nixpkgs": "nixpkgs_3", @@ -2496,7 +2458,7 @@ }, "pre-commit-hooks_2": { "inputs": { - "flake-compat": "flake-compat_5", + "flake-compat": "flake-compat_4", "flake-utils": "flake-utils_7", "gitignore": "gitignore_2", "nixpkgs": "nixpkgs_11", @@ -2518,7 +2480,7 @@ }, "pre-commit-hooks_3": { "inputs": { - "flake-compat": "flake-compat_6", + "flake-compat": "flake-compat_5", "flake-utils": "flake-utils_8", "gitignore": "gitignore_3", "nixpkgs": "nixpkgs_12", @@ -2540,7 +2502,7 @@ }, "pre-commit-hooks_4": { "inputs": { - "flake-compat": "flake-compat_8", + "flake-compat": "flake-compat_7", "flake-utils": "flake-utils_10", "gitignore": "gitignore_4", "nixpkgs": "nixpkgs_14", @@ -2562,7 +2524,7 @@ }, "pre-commit-hooks_5": { "inputs": { - "flake-compat": "flake-compat_9", + "flake-compat": "flake-compat_8", "flake-utils": "flake-utils_11", "gitignore": "gitignore_5", "nixpkgs": "nixpkgs_15", @@ -2604,7 +2566,6 @@ "anyrun": "anyrun", "anyrun-nixos-options": "anyrun-nixos-options", "catppuccin-base16": "catppuccin-base16", - "deploy-rs": "deploy-rs", "disko": "disko", "firefox-addons": "firefox-addons", "grub2-themes": "grub2-themes", @@ -2616,8 +2577,8 @@ "intray": "intray", "matui": "matui", "neovim-nightly-overlay": "neovim-nightly-overlay", + "nix-index-database": "nix-index-database", "nixd": "nixd", - "nixinate": "nixinate", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_6", "nixpkgs-stable": "nixpkgs-stable_2", @@ -2936,7 +2897,7 @@ "base16-kitty": "base16-kitty", "base16-tmux": "base16-tmux", "base16-vim": "base16-vim", - "flake-compat": "flake-compat_7", + "flake-compat": "flake-compat_6", "home-manager": [ "home-manager" ], @@ -3313,21 +3274,6 @@ "type": "github" } }, - "utils": { - "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "validity": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 4294ff8..8f3359e 100644 --- a/flake.nix +++ b/flake.nix @@ -3,111 +3,66 @@ # {{{ Inputs inputs = { - # Nixpkgs + # {{{ Nixpkgs instances nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-23.11"; nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; - - # Home manager - home-manager.url = "github:nix-community/home-manager/release-23.11"; - home-manager.inputs.nixpkgs.follows = "nixpkgs"; - - # NUR + # }}} + # {{{ Additional package repositories nur.url = "github:nix-community/NUR"; - # Firefox addons - firefox-addons.url = "git+https://gitlab.com/rycee/nur-expressions?dir=pkgs/firefox-addons"; - firefox-addons.inputs.nixpkgs.follows = "nixpkgs"; - - # Agenix - agenix.url = "github:ryantm/agenix"; - agenix.inputs.nixpkgs.follows = "nixpkgs"; - - # Homeage - homeage.url = "github:jordanisaacs/homeage"; - homeage.inputs.nixpkgs.follows = "nixpkgs"; - - # Grub2 themes - grub2-themes.url = "github:vinceliuice/grub2-themes"; - grub2-themes.inputs.nixpkgs.follows = "nixpkgs"; - - # Stylix - stylix.url = "github:danth/stylix"; - stylix.inputs.nixpkgs.follows = "nixpkgs"; - stylix.inputs.home-manager.follows = "home-manager"; - - # Catpuccin base16 color schemes - catppuccin-base16.url = "github:catppuccin/base16"; - catppuccin-base16.flake = false; - - # Rosepine base16 color schemes - rosepine-base16.url = "github:edunfelt/base16-rose-pine-scheme"; - rosepine-base16.flake = false; - - # Impermanence - impermanence.url = "github:nix-community/impermanence"; - - # Slambda - slambda.url = "github:Mateiadrielrafael/slambda"; - slambda.inputs.nixpkgs.follows = "nixpkgs"; - - # Neovim nightly - neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; - neovim-nightly-overlay.inputs.nixpkgs.follows = "nixpkgs"; - - # Hyprland (available in nix unstable only atm) - hyprland.url = "github:hyprwm/Hyprland"; - hyprland.inputs.nixpkgs.follows = "nixpkgs"; - - # Hyprland-contrib hyprland-contrib.url = "github:hyprwm/contrib"; hyprland-contrib.inputs.nixpkgs.follows = "nixpkgs"; + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + # Contains a bunch of wayland stuff not on nixpkgs nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland"; nixpkgs-wayland.inputs.nixpkgs.follows = "nixpkgs"; + # Firefox addons + firefox-addons.url = "git+https://gitlab.com/rycee/nur-expressions?dir=pkgs/firefox-addons"; + firefox-addons.inputs.nixpkgs.follows = "nixpkgs"; + # }}} + # {{{ Nix-related tooling + # {{{ Secret management + agenix.url = "github:ryantm/agenix"; + agenix.inputs.nixpkgs.follows = "nixpkgs"; + + homeage.url = "github:jordanisaacs/homeage"; + homeage.inputs.nixpkgs.follows = "nixpkgs"; + # }}} + # {{{ Storage + impermanence.url = "github:nix-community/impermanence"; + + # Declarative partitioning + disko.url = "github:nix-community/disko"; + disko.inputs.nixpkgs.follows = "nixpkgs"; + # }}} + + home-manager.url = "github:nix-community/home-manager/release-23.11"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + + nix-index-database.url = "github:Mic92/nix-index-database"; + nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; + # Nix language server # [the docs](https://github.com/nix-community/nixd/blob/main/docs/user-guide.md#installation) # tell me not to override the nixpkgs input. nixd.url = "github:nix-community/nixd"; + # }}} + # {{{ Standalone software + # {{{ Nightly versions of things + hyprland.url = "github:hyprwm/Hyprland"; + hyprland.inputs.nixpkgs.follows = "nixpkgs"; - # Spotify client - spicetify-nix.url = "github:the-argus/spicetify-nix"; - spicetify-nix.inputs.nixpkgs.follows = "nixpkgs"; - - # Disko - disko.url = "github:nix-community/disko"; - disko.inputs.nixpkgs.follows = "nixpkgs"; - - # Deploy-rs - deploy-rs.url = "github:serokell/deploy-rs"; - deploy-rs.inputs.nixpkgs.follows = "nixpkgs"; - - # Nixinate - nixinate.url = "github:matthewcroughan/nixinate"; - nixinate.inputs.nixpkgs.follows = "nixpkgs"; - - # Anyrun - anyrun.url = "github:Kirottu/anyrun"; - anyrun.inputs.nixpkgs.follows = "nixpkgs"; - - # Anyrun nixos options - anyrun-nixos-options.url = "github:n3oney/anyrun-nixos-options"; - anyrun-nixos-options.inputs.nixpkgs.follows = "nixpkgs"; - - # Nixos hardware - nixos-hardware.url = "github:NixOS/nixos-hardware/master"; - - # Matrix TUi - matui.url = "github:pkulak/matui"; - matui.inputs.nixpkgs.follows = "nixpkgs"; - - # Wezterm nightly # https://github.com/happenslol/wezterm/blob/add-nix-flake/nix/flake.nix wezterm.url = "github:happenslol/wezterm/add-nix-flake?dir=nix"; wezterm.inputs.nixpkgs.follows = "nixpkgs"; + neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; + neovim-nightly-overlay.inputs.nixpkgs.follows = "nixpkgs"; + # }}} # {{{ Self management # Smos smos.url = "github:NorfairKing/smos"; @@ -125,6 +80,43 @@ tickler.inputs.nixpkgs.follows = "nixpkgs"; tickler.inputs.intray.follows = "intray"; # }}} + # {{{ Anyrun + anyrun.url = "github:Kirottu/anyrun"; + anyrun.inputs.nixpkgs.follows = "nixpkgs"; + + anyrun-nixos-options.url = "github:n3oney/anyrun-nixos-options"; + anyrun-nixos-options.inputs.nixpkgs.follows = "nixpkgs"; + # }}} + + matui.url = "github:pkulak/matui"; + matui.inputs.nixpkgs.follows = "nixpkgs"; + + # Spotify client with theming support + spicetify-nix.url = "github:the-argus/spicetify-nix"; + spicetify-nix.inputs.nixpkgs.follows = "nixpkgs"; + + # Keyboard configuration (to be replaced by kanata at some point) + slambda.url = "github:Mateiadrielrafael/slambda"; + slambda.inputs.nixpkgs.follows = "nixpkgs"; + # }}} + # {{{ Theming + # Grub2 themes + grub2-themes.url = "github:vinceliuice/grub2-themes"; + grub2-themes.inputs.nixpkgs.follows = "nixpkgs"; + + # Stylix + stylix.url = "github:danth/stylix"; + stylix.inputs.nixpkgs.follows = "nixpkgs"; + stylix.inputs.home-manager.follows = "home-manager"; + + # Catpuccin base16 color schemes + catppuccin-base16.url = "github:catppuccin/base16"; + catppuccin-base16.flake = false; + + # Rosepine base16 color schemes + rosepine-base16.url = "github:edunfelt/base16-rose-pine-scheme"; + rosepine-base16.flake = false; + # }}} }; # }}} @@ -152,22 +144,7 @@ # Acessible through 'nix build', 'nix shell', etc packages = forAllSystems (system: let pkgs = nixpkgs.legacyPackages.${system}; - in import ./pkgs { inherit pkgs; } // { - nix-tree = (pkgs.nix-tree.overrideAttrs (oldAttrs: { - patches = - (oldAttrs.patches or []) - ++ [ - (pkgs.fetchpatch { - url = "https://github.com/utdemir/nix-tree/pull/68.patch"; - hash = "sha256-70Xo88ZWzWUYM0qxbW64kYaVwHaYkS2dQWmBGCkL0oA="; - }) - (pkgs.fetchpatch { - url = "https://github.com/utdemir/nix-tree/pull/69.patch"; - hash = "sha256-8LdOKU2pc0tojmquCEqjnovkG3hD7YdTQoC4WSawdAQ="; - }) - ]; -})); - } + in import ./pkgs { inherit pkgs; } ); # }}} # {{{ Bootstrapping and other pinned devshells @@ -176,11 +153,9 @@ (system: let pkgs = nixpkgs.legacyPackages.${system}; - default = import ./shell.nix { inherit pkgs; }; args = { inherit pkgs; } // specialArgs system; - devshells = import ./devshells args; in - devshells // { inherit default; }); + ./devshells args); # }}} # {{{ Overlays and modules # Custom packages and modifications, exported as overlays @@ -209,12 +184,6 @@ stylix.homeManagerIntegration.followSystem = false; stylix.homeManagerIntegration.autoImport = false; - - _module.args.nixinate = { - host = hostname; - sshUser = "adrielus"; - buildOn = "remote"; - }; } ./hosts/nixos/${hostname} @@ -284,27 +253,6 @@ }; }; # }}} - # {{{ Deploy-rs nodes - deploy.nodes = - let deployNixos = hostname: { - user = "root"; - path = inputs.deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.${hostname}; - }; - in - { - lapetus.hostname = "lapetus"; - lapetus.sshOpts = [ "-t" ]; - lapetus.profiles.system = deployNixos "lapetus"; - }; - # }}} - # {{{ Checks - # This is highly advised, and will prevent many possible mistakes - # Taken from [the deploy-rs docs](https://github.com/serokell/deploy-rs). - checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib; - # }}} - # # {{{ Apps - # apps.x86_64-linux = (inputs.nixinate.nixinate.x86_64-linux self); - # # }}} }; # {{{ Caching and whatnot diff --git a/home/features/cli/default.nix b/home/features/cli/default.nix index 044764b..962940a 100644 --- a/home/features/cli/default.nix +++ b/home/features/cli/default.nix @@ -34,7 +34,6 @@ # }}} # {{{ Misc ranger # Terminal file explorer - comma # Intstall and run programs by sticking a , before them bc # Calculator ouch # Unified compression / decompression tool mkpasswd # Hash passwords diff --git a/home/features/cli/eza.nix b/home/features/cli/eza.nix index e917307..8764d1a 100644 --- a/home/features/cli/eza.nix +++ b/home/features/cli/eza.nix @@ -4,8 +4,7 @@ in { home.packages = [ package ]; - # TODO: generalize alias creation to all shells - programs.fish.shellAliases = + home.shellAliases = let eza = lib.getExe package; in rec { diff --git a/home/features/cli/git.nix b/home/features/cli/git.nix index 9479a22..77105e2 100644 --- a/home/features/cli/git.nix +++ b/home/features/cli/git.nix @@ -1,4 +1,6 @@ { pkgs, ... }: { + # TODO: use `delta` as a pager, as highlighted here + # https://github.com/lilyinstarlight/foosteros/blob/main/config/base.nix#L163 programs.git = { enable = true; package = pkgs.gitFull; @@ -6,6 +8,7 @@ userName = "Matei Adriel"; userEmail = "rafaeladriel11@gmail.com"; + # {{{ Globally ignored files ignores = [ # Syncthing ".stfolder" @@ -22,7 +25,8 @@ # it have it commited). "hie.yaml" ]; - + # }}} + # {{{ Aliases aliases = { # Print history nicely graph = "log --decorate --oneline --graph"; @@ -30,6 +34,7 @@ # Print last commit's hash hash = "log -1 --format='%H'"; }; + # }}} extraConfig = { github.user = "Mateiadrielrafael"; @@ -38,6 +43,7 @@ init.defaultBranch = "main"; rebase.autoStash = true; + # {{{ Signing # Sign commits using ssh gpg.format = "ssh"; user.signingkey = "~/.ssh/id_ed25519.pub"; @@ -45,12 +51,14 @@ # Sign everything by default commit.gpgsign = true; tag.gpgsign = true; + # }}} }; }; - # Github cli + # {{{ Github cli programs.gh = { enable = true; settings.git_protocol = "ssh"; }; + # }}} } diff --git a/home/features/cli/nix-index.nix b/home/features/cli/nix-index.nix new file mode 100644 index 0000000..28b6c15 --- /dev/null +++ b/home/features/cli/nix-index.nix @@ -0,0 +1,5 @@ +{ + programs.nix-index-database.comma.enable = true; + programs.nix-index.enable = true; + programs.command-not-found.enable = false; +} diff --git a/home/features/cli/starship.nix b/home/features/cli/starship.nix index bd61e79..796f0ea 100644 --- a/home/features/cli/starship.nix +++ b/home/features/cli/starship.nix @@ -1,5 +1,3 @@ { - programs.starship = { -enable = true; - }; - } + programs.starship.enable = true; +} diff --git a/home/features/desktop/wakatime/default.nix b/home/features/desktop/wakatime/default.nix index a1d676c..bb555e8 100644 --- a/home/features/desktop/wakatime/default.nix +++ b/home/features/desktop/wakatime/default.nix @@ -6,5 +6,5 @@ ]; }; - home.packages = with pkgs; [ wakatime ]; + home.packages = [ pkgs.wakatime ]; } diff --git a/home/features/neovim/default.nix b/home/features/neovim/default.nix index f68fd44..d6c18af 100644 --- a/home/features/neovim/default.nix +++ b/home/features/neovim/default.nix @@ -127,7 +127,10 @@ let # }}} # {{{ Clients neovim = wrapClient { - base = pkgs.neovim; + base = + if config.satellite.toggles.neovim-nightly.enable + then pkgs.neovim-nightly + else pkgs.neovim; name = "nvim"; }; diff --git a/home/global.nix b/home/global.nix index 1a6163c..9b88536 100644 --- a/home/global.nix +++ b/home/global.nix @@ -2,28 +2,29 @@ let # {{{ Imports imports = [ + # {{{ flake inputs inputs.stylix.homeManagerModules.stylix inputs.homeage.homeManagerModules.homeage inputs.nur.nixosModules.nur inputs.impermanence.nixosModules.home-manager.impermanence inputs.spicetify-nix.homeManagerModules.spicetify inputs.anyrun.homeManagerModules.default + inputs.nix-index-database.hmModules.nix-index + # {{{ self management # NOTE: using `pkgs.system` before `module.options` is evaluated # leads to infinite recursion! inputs.intray.homeManagerModules.x86_64-linux.default inputs.smos.homeManagerModules.x86_64-linux.default - + # }}} + # }}} + # {{{ global configuration ./features/cli ./features/persistence.nix ../common + # }}} ]; # }}} - # {{{ Overlays - overlays = [ - # inputs.neovim-nightly-overlay.overlay - ]; - # }}} in { # Import all modules defined in modules/home-manager @@ -32,31 +33,30 @@ in # {{{ Nixpkgs nixpkgs = { # Add all overlays defined in the overlays directory - overlays = builtins.attrValues outputs.overlays ++ overlays; + overlays = builtins.attrValues outputs.overlays ++ + lib.lists.optional + config.satellite.toggles.neovim-nightly.enable + inputs.neovim-nightly-overlay.overlay; - # Allow unfree packages - config = { - allowUnfree = true; - allowUnfreePredicate = (_: true); - }; + config.allowUnfree = true; }; # }}} - - # Nicely reload system units when changing configs - systemd.user.startServices = lib.mkForce "sd-switch"; - - # Enable the home-manager and git clis + # {{{ Enable the home-manager and git clis programs = { home-manager.enable = true; git.enable = true; }; - - # Set reasonable defaults for some settings + # }}} + # {{{ Set reasonable defaults for some settings home = { username = lib.mkDefault "adrielus"; homeDirectory = lib.mkDefault "/home/${config.home.username}"; stateVersion = lib.mkDefault "23.05"; }; + # }}} + # {{{ Ad-hoc settings + # Nicely reload system units when changing configs + systemd.user.startServices = lib.mkForce "sd-switch"; # Where homeage should look for our ssh key homeage.identityPaths = [ "~/.ssh/id_ed25519" ]; @@ -64,18 +64,18 @@ in # Allow root to read persistent files from this user. home.persistence."/persist/home/adrielus".allowOther = true; + # {{{ Ad-hoc stylix targets + stylix.targets.xresources.enable = true; + # }}} + # }}} + # {{{ Xdg user directories # Set the xdg env vars xdg.enable = true; - # {{{ Xdg user directories xdg.userDirs = { enable = lib.mkDefault true; createDirectories = lib.mkDefault false; extraConfig.XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots"; }; # }}} - # {{{ Ad-hoc stylix targets - # TODO: is this useful outside xorg? - stylix.targets.xresources.enable = true; - # }}} } diff --git a/home/tethys.nix b/home/tethys.nix index c2c5e3d..891c546 100644 --- a/home/tethys.nix +++ b/home/tethys.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{ pkgs, lib, config, ... }: { imports = [ ./global.nix @@ -8,10 +8,9 @@ ./features/desktop/discord ./features/cli/productivity ./features/cli/pass.nix - ./features/neovim - - # ./features/xorg/xmonad.nix + ./features/cli/nix-index.nix ./features/wayland/hyprland + ./features/neovim ]; # Arbitrary extra packages diff --git a/hosts/nixos/common/global/fish.nix b/hosts/nixos/common/global/cli/fish.nix similarity index 100% rename from hosts/nixos/common/global/fish.nix rename to hosts/nixos/common/global/cli/fish.nix diff --git a/hosts/nixos/common/global/cli/htop.nix b/hosts/nixos/common/global/cli/htop.nix new file mode 100644 index 0000000..eb01bb5 --- /dev/null +++ b/hosts/nixos/common/global/cli/htop.nix @@ -0,0 +1,8 @@ +{ + programs.htop = { + enable = true; + settings = { + tree_view = true; + }; + }; +} diff --git a/hosts/nixos/common/global/sudo.nix b/hosts/nixos/common/global/cli/sudo.nix similarity index 100% rename from hosts/nixos/common/global/sudo.nix rename to hosts/nixos/common/global/cli/sudo.nix diff --git a/hosts/nixos/common/global/default.nix b/hosts/nixos/common/global/default.nix index 69f892e..550131a 100644 --- a/hosts/nixos/common/global/default.nix +++ b/hosts/nixos/common/global/default.nix @@ -1,8 +1,9 @@ # Configuration pieces included on all (nixos) hosts -{ inputs, outputs, ... }: +{ inputs, lib, config, outputs, ... }: let # {{{ Imports imports = [ + # {{{ flake inputs # inputs.hyprland.nixosModules.default inputs.disko.nixosModules.default inputs.agenix.nixosModules.default @@ -11,20 +12,26 @@ let inputs.impermanence.nixosModule inputs.slambda.nixosModule + # {{{ self management # NOTE: using `pkgs.system` before `module.options` is evaluated # leads to infinite recursion! inputs.intray.nixosModules.x86_64-linux.default inputs.smos.nixosModules.x86_64-linux.default inputs.tickler.nixosModules.x86_64-linux.default - - ./persistence.nix + # }}} + # }}} + # {{{ global configuration + ./cli/fish.nix + ./cli/htop.nix + ./services/openssh.nix + ./services/tailscale.nix ./nix.nix - ./openssh.nix - ./fish.nix ./locale.nix + ./persistence.nix ./wireless - ./tailscale.nix + ../../../../common + # }}} ]; # }}} in @@ -32,6 +39,7 @@ in # Import all modules defined in modules/nixos imports = builtins.attrValues outputs.nixosModules ++ imports; + # {{{ ad-hoc options # Allow non root users to specify the "allowOther" option. # See [the imperanence readme](https://github.com/nix-community/impermanence#home-manager) programs.fuse.userAllowOther = true; @@ -39,14 +47,19 @@ in # Customize tty colors stylix.targets.console.enable = true; + # Reduce the amount of storage spent for logs + services.journald.extraConfig = lib.mkDefault '' + SystemMaxUse=256M + ''; + # }}} + nixpkgs = { # Add all overlays defined in the overlays directory - overlays = builtins.attrValues outputs.overlays ++ [ - # inputs.neovim-nightly-overlay.overlay - ]; + overlays = builtins.attrValues outputs.overlays ++ + lib.lists.optional + config.satellite.toggles.neovim-nightly.enable + inputs.neovim-nightly-overlay.overlay; - config = { - allowUnfree = true; - }; + config.allowUnfree = true; }; } diff --git a/hosts/nixos/common/global/openssh.nix b/hosts/nixos/common/global/services/openssh.nix similarity index 100% rename from hosts/nixos/common/global/openssh.nix rename to hosts/nixos/common/global/services/openssh.nix diff --git a/hosts/nixos/common/global/tailscale.nix b/hosts/nixos/common/global/services/tailscale.nix similarity index 100% rename from hosts/nixos/common/global/tailscale.nix rename to hosts/nixos/common/global/services/tailscale.nix diff --git a/hosts/nixos/common/optional/steam.nix b/hosts/nixos/common/optional/desktop/steam.nix similarity index 100% rename from hosts/nixos/common/optional/steam.nix rename to hosts/nixos/common/optional/desktop/steam.nix diff --git a/hosts/nixos/common/optional/xdg-portal.nix b/hosts/nixos/common/optional/desktop/xdg-portal.nix similarity index 100% rename from hosts/nixos/common/optional/xdg-portal.nix rename to hosts/nixos/common/optional/desktop/xdg-portal.nix diff --git a/hosts/nixos/common/optional/gitea.nix b/hosts/nixos/common/optional/services/gitea.nix similarity index 100% rename from hosts/nixos/common/optional/gitea.nix rename to hosts/nixos/common/optional/services/gitea.nix diff --git a/hosts/nixos/common/optional/slambda.nix b/hosts/nixos/common/optional/services/slambda.nix similarity index 100% rename from hosts/nixos/common/optional/slambda.nix rename to hosts/nixos/common/optional/services/slambda.nix diff --git a/hosts/nixos/common/optional/syncthing.nix b/hosts/nixos/common/optional/services/syncthing.nix similarity index 100% rename from hosts/nixos/common/optional/syncthing.nix rename to hosts/nixos/common/optional/services/syncthing.nix diff --git a/hosts/nixos/common/optional/hyprland.nix b/hosts/nixos/common/optional/wayland/hyprland.nix similarity index 84% rename from hosts/nixos/common/optional/hyprland.nix rename to hosts/nixos/common/optional/wayland/hyprland.nix index 57684d4..ad9f273 100644 --- a/hosts/nixos/common/optional/hyprland.nix +++ b/hosts/nixos/common/optional/wayland/hyprland.nix @@ -1,5 +1,5 @@ # The main configuration is specified by home-manager -{ inputs, pkgs, ... }: { +{ pkgs, ... }: { programs.hyprland.enable = true; programs.hyprland.package = pkgs.hyprland; } diff --git a/hosts/nixos/common/optional/lightdm.nix b/hosts/nixos/common/optional/xorg/lightdm.nix similarity index 100% rename from hosts/nixos/common/optional/lightdm.nix rename to hosts/nixos/common/optional/xorg/lightdm.nix diff --git a/hosts/nixos/common/optional/touchpad.nix b/hosts/nixos/common/optional/xorg/touchpad.nix similarity index 100% rename from hosts/nixos/common/optional/touchpad.nix rename to hosts/nixos/common/optional/xorg/touchpad.nix diff --git a/hosts/nixos/common/optional/xmonad/Main.hs b/hosts/nixos/common/optional/xorg/xmonad/Main.hs similarity index 100% rename from hosts/nixos/common/optional/xmonad/Main.hs rename to hosts/nixos/common/optional/xorg/xmonad/Main.hs diff --git a/hosts/nixos/common/optional/xmonad/default.nix b/hosts/nixos/common/optional/xorg/xmonad/default.nix similarity index 100% rename from hosts/nixos/common/optional/xmonad/default.nix rename to hosts/nixos/common/optional/xorg/xmonad/default.nix diff --git a/hosts/nixos/common/optional/xserver.nix b/hosts/nixos/common/optional/xorg/xserver.nix similarity index 100% rename from hosts/nixos/common/optional/xserver.nix rename to hosts/nixos/common/optional/xorg/xserver.nix diff --git a/hosts/nixos/euporie/default.nix b/hosts/nixos/euporie/default.nix index 9a205be..57e6e4b 100644 --- a/hosts/nixos/euporie/default.nix +++ b/hosts/nixos/euporie/default.nix @@ -3,10 +3,10 @@ ../common/global ../common/users/guest.nix + ../common/optional/greetd.nix ../common/optional/pipewire.nix - ../common/optional/lightdm.nix - ../common/optional/xdg-portal.nix - ../common/optional/hyprland.nix + ../common/optional/desktop/xdg-portal.nix + ../common/optional/wayland/hyprland.nix ]; # Usually included in the hardware-configuration diff --git a/hosts/nixos/lapetus/default.nix b/hosts/nixos/lapetus/default.nix index 566f015..5e5c2aa 100644 --- a/hosts/nixos/lapetus/default.nix +++ b/hosts/nixos/lapetus/default.nix @@ -2,7 +2,7 @@ imports = [ ../common/global ../common/users/adrielus.nix - ../common/optional/slambda.nix + ../common/optional/services/slambda.nix ./services/syncthing.nix ./filesystems diff --git a/hosts/nixos/lapetus/services/syncthing.nix b/hosts/nixos/lapetus/services/syncthing.nix index 4f520a3..efaff74 100644 --- a/hosts/nixos/lapetus/services/syncthing.nix +++ b/hosts/nixos/lapetus/services/syncthing.nix @@ -1,5 +1,5 @@ { - imports = [ ../../common/optional/syncthing.nix ]; + imports = [ ../../common/optional/services/syncthing.nix ]; networking.firewall.allowedTCPPorts = [ 8384 ]; diff --git a/hosts/nixos/tethys/default.nix b/hosts/nixos/tethys/default.nix index 4800519..e0a7006 100644 --- a/hosts/nixos/tethys/default.nix +++ b/hosts/nixos/tethys/default.nix @@ -1,31 +1,30 @@ { lib, ... }: { + # {{{ Imports imports = [ ../common/global ../common/users/adrielus.nix ../common/optional/pipewire.nix ../common/optional/greetd.nix - # ../common/optional/xmonad - # ../common/optional/lightdm.nix - ../common/optional/steam.nix - ../common/optional/slambda.nix - ../common/optional/xdg-portal.nix - ../common/optional/hyprland.nix ../common/optional/quietboot.nix - # ../common/optional/gitea.nix + ../common/optional/desktop/steam.nix + ../common/optional/services/slambda.nix + ../common/optional/desktop/xdg-portal.nix + ../common/optional/wayland/hyprland.nix ./hardware - ./services/syncthing.nix ./boot.nix + ./services/syncthing.nix ]; - - # Machine ids - networking.hostName = "tethys"; - environment.etc.machine-id.text = "08357db3540c4cd2b76d4bb7f825ec88"; + # }}} # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion system.stateVersion = "22.11"; + # {{{ Machine ids + networking.hostName = "tethys"; + environment.etc.machine-id.text = "08357db3540c4cd2b76d4bb7f825ec88"; + # }}} # {{{ A few ad-hoc hardware settings hardware.enableAllFirmware = true; hardware.opengl.enable = true; diff --git a/hosts/nixos/tethys/hardware/generated.nix b/hosts/nixos/tethys/hardware/generated.nix index 77ccfd2..e1b882a 100644 --- a/hosts/nixos/tethys/hardware/generated.nix +++ b/hosts/nixos/tethys/hardware/generated.nix @@ -1,7 +1,7 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ config, lib, modulesPath, ... }: { imports = diff --git a/hosts/nixos/tethys/services/syncthing.nix b/hosts/nixos/tethys/services/syncthing.nix index 84844d8..fd9498d 100644 --- a/hosts/nixos/tethys/services/syncthing.nix +++ b/hosts/nixos/tethys/services/syncthing.nix @@ -9,7 +9,7 @@ let }; in { - imports = [ ../../common/optional/syncthing.nix ]; + imports = [ ../../common/optional/services/syncthing.nix ]; services.syncthing.settings.folders = { "mythical-vault" = { diff --git a/modules/common/lua-colorscheme.nix b/modules/common/lua-colorscheme.nix index 9383b7c..37bc9f1 100644 --- a/modules/common/lua-colorscheme.nix +++ b/modules/common/lua-colorscheme.nix @@ -47,8 +47,8 @@ popups = config.stylix.opacity.popups < 1.0; }; rounding = { - enable = toString config.satellite.theming.rounding.enable; - radius = toString config.satellite.theming.rounding.radius; + enable = config.satellite.theming.rounding.enable; + radius = config.satellite.theming.rounding.radius; }; }; in diff --git a/pkgs/plymouth-themes.nix b/pkgs/plymouth-themes.nix index 444948a..bf49ead 100644 --- a/pkgs/plymouth-themes.nix +++ b/pkgs/plymouth-themes.nix @@ -1,7 +1,7 @@ { pkgs ? import { } }: # See [this blog post](http://blog.sidhartharya.com/using-custom-plymouth-theme-on-nixos/) -let mkTheme = { themeName, pack }: pkgs.stdenv.mkDerivation rec { +let mkTheme = { themeName, pack }: pkgs.stdenv.mkDerivation { pname = "adi1090x-plymouth-${themeName}"; version = "0.0.1"; diff --git a/pkgs/vimclip.nix b/pkgs/vimclip.nix index 4b34123..74a4a6b 100644 --- a/pkgs/vimclip.nix +++ b/pkgs/vimclip.nix @@ -1,5 +1,5 @@ { pkgs, lib, ... }: -let vimclip = pkgs.stdenv.mkDerivation rec { +let vimclipRaw = pkgs.stdenv.mkDerivation rec { name = "vimclip"; rev = "52003cc31e6e1d20550cdf6b7d3bf1a019a34fa0"; @@ -26,5 +26,5 @@ pkgs.writeShellScriptBin "vimclip" '' export VIMCLIP_CLIPBOARD_COMMAND=${pkgs.xsel}/bin/xsel fi - ${lib.getExe vimclip} + ${lib.getExe vimclipRaw} ''