diff --git a/.gitignore b/.gitignore
index 43f7455..c2a2fda 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
-secrets/
dotfiles/zsh/.zcompdump
dotfiles/nvim/lazy-lock.json
+result
+keys.txt
diff --git a/README.md b/README.md
index 954af14..9d1e8d8 100644
--- a/README.md
+++ b/README.md
@@ -1,83 +1,213 @@
-# nixos-system-config
-My modular NixOS configuration.
+# caenix
-## About
-This is the NixOS configuration that I daily drive on my system. Feel free to use,
-modify and share this configuration to your heart's content, no attribution required.
-
-## Screenshots
-|KDE Plasma|Hyprland|
-|---|---|
-|||
+
+
+
+ About
+ |
+
+ Screenshot
+ |
+
+
+
+ This repository contains my personal NixOS configuration.
+ Feel free to do whatever with it.
+ |
+
+
+ |
+
+
## Layout
```
-├── assets ; Binary assets tracked in git
-│ ├── screenshot.png
-│ └── wallpaper.jpg
-├── dotfiles ; Distro agnostic dotfiles
-│ └── ... ; Stores configurations that do not depend on Nix
-├── flake.lock
-├── flake.nix ; Entry point
-├── home ; home-manager configuration
-│ ├── default.nix ; User and home-manager options
-│ ├── packages ; Per-package home-manager configuration
-│ │ └── ...
-│ └── persist.nix ; Home opt-in state directories and files
-├── hosts ; Host configurations
-│ └── workstation
-│ ├── default.nix ; Host configuration.nix equivalent
-│ ├── hardware-configuration.nix ; Host hardware specific configuration
-│ └── persist.nix ; System wide opt-in state directories and files
-├── lib ; Custom helper functions
-│ ├── default.nix
-│ └── ...
-├── modules ; System modules and sets of packages
-│ ├── desktop
-│ │ ├── apps
-│ │ │ └── ...
-│ │ └── environments
-│ │ └── ...
-│ └── system
-│ └── ...
+.
+├── .gitattributes
+├── .gitignore
├── README.md
-└── secrets ; Location of secrets not tracked in the git tree
- └── pass
+├── assets ; Binary assets such as screenshots and wallpapers
+│ └── ...
+├── flake.lock
+├── flake.nix
+├── hosts ; Host configurations
+│ ├── puter
+│ │ ├── default.nix ; Host specific configuration options
+│ │ ├── disko.nix ; Host specific partitioning layout
+│ │ └── packages.nix ; Host specific package set
+│ └── ...
+├── install.sh
+├── lib ; Custom helper functions
+│ └── ...
+├── modules ; Configuration modules
+│ ├── home ; Home-manager modules
+│ │ └── caem ; User home-manager modules
+│ │ ├── default.nix ; User specific configuration options
+│ │ ├── packages.nix ; User specific package set
+│ │ └── ...
+│ └── nixos ; NixOS modules
+│ ├── user ; User definition
+│ │ └── caem.nix
+│ └── ...
+└── overlays ; Overlays
+ └── ...
```
-## Installing
-This configuration uses impermanence with btrfs snapshots so you'll have to partition
-your system in a certain way.
+## Installation
-First you'll need this partition layout, assuming you're installing on `nvme0n1`.
-```
-DEVICE FILESYSTEM PURPOSE
-/dev/nvme0n1
-├─/dev/nvme0n1p1 vfat EFI partition
-└─/dev/nvme0n1p2 btrfs Partition to house all the subvolumes
-```
+### Setting up your secrets repository
-Inside of the btrfs root volume we're going to need 2 subvolumes.
-```
-SUBVOLUME MOUNT PURPOSE
-root / Impermanent data
-nix /nix Permanent data
-```
+This step is required to install the system as it is built around nix-sops
+with encrypted files in a private repository in order to not expose even the
+encrypted secrets to the public. You don't need to be in a NixOS livecd or
+system in order to complete this step as long as you can install all
+requirements from step 1.
-You'll also need to create a read-only snapshot of the `root` subvolume
-and call it `root-blank`.
+#### 1. Ensure all required dependencies are present
-After you've mounted all the subvolumes and EFI partition (`/boot`) in `/mnt`
-clone this repository in to `/mnt/nix/config`. Adjust all the block ids of the partitions
-in `hardware-configuration.nix` and create a hashed password using `mkpasswd` and store it
-in the `secrets` directory as `pass`.
-
-Finally, in the config directory run `nixos-install --flake '.#'`, reboot and you're done.
-
-## Updating
-This configuration sets up [nh](https://github.com/viperML/nh) for a prettier and more convenient
-way of keeping the system up to date. To update you can simply run:
```sh
-nix flake update /nix/config
-nh os switch
+nix-shell -p sops age git wl-clipboard
```
+
+#### 2. Initialize your secrets repo
+
+```sh
+mkdir secrets
+cd secrets
+git init
+```
+
+#### 3. Create your gitignore
+
+You want this to make sure that you do not accidentally push your private key.
+
+```sh
+echo "keys.txt" > .gitignore
+```
+
+#### 4. Generate your private key
+
+```sh
+age-keygen -o ./keys.txt
+```
+
+#### 5. Create your sops configuration file
+
+```sh
+cat < .sops.yaml
+keys:
+ - &master $(age-keygen -y ./keys.txt)
+creation_rules:
+ - path_regex: .*\.(yaml|json|env|ini)$
+ key_groups:
+ - age:
+ - *master
+EOF
+```
+
+#### 6. Create your secrets file
+
+```sh
+mkpasswd | wl-copy
+sops upasswd.yaml
+```
+
+Then edit the file to look like this
+```yaml
+upasswd: [The pasted password from mkpasswd]
+```
+
+#### 7. Create the flake to expose the secrets
+
+```sh
+cat < flake.nix
+{
+ outputs = { self, ... }: {
+ paths = {
+ upasswd = self + "/upasswd.yaml";
+ };
+ };
+}
+EOF
+```
+
+#### 8. Commit and push your changes
+
+If your git forge supports creating the repository on push you can
+simply run the commands below, if it does not, like GitHub, create a private
+repository named "secrets" first before running the below commands.
+
+```sh
+git remote add origin git@git.example.net:username/secrets
+git add .
+git commit -m "batman"
+git push --set-upstream origin master
+```
+
+#### 9. Back up your keys.txt
+
+**THIS STEP IS VERY IMPORTANT**
+
+Back up your keys.txt in a safe location where you can later transfer it on to the livecd.
+Keep it safe afterwards as it is required to decrypt your secrets. Do not share this with
+anyone else as it'd allow them to decrypt all your secrets.
+
+You also need to have a copy of your ssh private key or (preferably) deployment key to the repository
+ready to later clone your secrets repository.
+
+### Installing the system
+
+#### 0. Boot in to a livcd image
+
+Any of the official NixOS livecds will work as long as you're able securely transfer files on to
+it. Non-nixos livecds might work if you install the required tools manually but is out of scope
+of this document.
+
+#### 1. Clone this repository
+
+```sh
+git clone https://github.com/c4em/caenix.git
+cd caenix
+```
+
+#### 2. Fetch your keys.txt and ssh key
+
+Fetch your keys.txt from wherever you've stored them and **place them at the root of the configuration directory**.
+If you place them anywhere else the installation will fail. Do not move them later either.
+
+For your ssh key, place it in `~/.ssh` and create a symlink for the root user.
+```sh
+sudo ln -sf /home/nixos/.ssh /root/.ssh
+```
+
+And start a instance of ssh-agent.
+```sh
+eval $(ssh-agent -s)
+ssh-add ~/.ssh/[your key]
+```
+
+#### 3. Update the flake input for your secret
+
+In `flake.nix`, replace
+```nix
+ inputs = {
+ secrets.url = "git+ssh://git@git.caem.dev/caem/secrets";
+```
+with your url.
+```nix
+ inputs = {
+ secrets.url = "git+ssh://git@git.example.com/username/secrets";
+```
+
+#### 4. Update flake.lock (optional)
+This is very useful and will also tell you if cloning your secrets work,
+rather than only telling you after already having partitioned the drive.
+```sh
+nix --extra-experimental-features 'nix-command flakes' flake update
+```
+
+#### 5. Run the installation script
+```sh
+./install.sh --host [your host] --device [the device to install NixOS on]
+```
+
diff --git a/assets/README.md b/assets/README.md
new file mode 100644
index 0000000..2dce282
--- /dev/null
+++ b/assets/README.md
@@ -0,0 +1,5 @@
+# assets
+
+The wallpaper used here is watermarked, the purchased version is stored in the secrets, inaccessible to the public.
+If you too want the watermark-free version you can [purchase it from the artist](https://wboss.huotan.com/p/TEcHBI)
+for mere ¥12. The artwork looks great, I'd highly recommend it.
diff --git a/assets/screenshot.png b/assets/screenshot.png
new file mode 100644
index 0000000..985fcf4
Binary files /dev/null and b/assets/screenshot.png differ
diff --git a/assets/screenshots/hyprland.png b/assets/screenshots/hyprland.png
deleted file mode 100644
index 3c7667e..0000000
Binary files a/assets/screenshots/hyprland.png and /dev/null differ
diff --git a/assets/screenshots/kde.png b/assets/screenshots/kde.png
deleted file mode 100644
index 48eebf3..0000000
Binary files a/assets/screenshots/kde.png and /dev/null differ
diff --git a/assets/wallpaper.jpg b/assets/wallpaper.jpg
new file mode 100644
index 0000000..77c180b
Binary files /dev/null and b/assets/wallpaper.jpg differ
diff --git a/assets/wallpapers/hyprland.jpg b/assets/wallpapers/hyprland.jpg
deleted file mode 100644
index c371260..0000000
Binary files a/assets/wallpapers/hyprland.jpg and /dev/null differ
diff --git a/assets/wallpapers/kde.png b/assets/wallpapers/kde.png
deleted file mode 100644
index d67050f..0000000
Binary files a/assets/wallpapers/kde.png and /dev/null differ
diff --git a/assets/wallpapers/river.png b/assets/wallpapers/river.png
deleted file mode 100644
index 879b65a..0000000
Binary files a/assets/wallpapers/river.png and /dev/null differ
diff --git a/dotfiles/deploy.sh b/dotfiles/deploy.sh
deleted file mode 100755
index 046bd5a..0000000
--- a/dotfiles/deploy.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-for f in *; do
- [ -d "$f" ] && ln -svf "$PWD/$f" "$HOME/.config"
-done
-
diff --git a/dotfiles/nvim/ftplugin/lua.lua b/dotfiles/nvim/ftplugin/lua.lua
deleted file mode 100644
index 4f74ce9..0000000
--- a/dotfiles/nvim/ftplugin/lua.lua
+++ /dev/null
@@ -1,3 +0,0 @@
-vim.bo.tabstop = 2
-vim.bo.softtabstop = 2
-vim.bo.shiftwidth = 2
diff --git a/dotfiles/nvim/ftplugin/nix.lua b/dotfiles/nvim/ftplugin/nix.lua
deleted file mode 100644
index 4f74ce9..0000000
--- a/dotfiles/nvim/ftplugin/nix.lua
+++ /dev/null
@@ -1,3 +0,0 @@
-vim.bo.tabstop = 2
-vim.bo.softtabstop = 2
-vim.bo.shiftwidth = 2
diff --git a/dotfiles/nvim/init.lua b/dotfiles/nvim/init.lua
deleted file mode 100644
index bd26c3b..0000000
--- a/dotfiles/nvim/init.lua
+++ /dev/null
@@ -1,3 +0,0 @@
-require"settings"
-require"plugins"
-
diff --git a/dotfiles/nvim/lua/plugins/cmp.lua b/dotfiles/nvim/lua/plugins/cmp.lua
deleted file mode 100644
index 1c5d700..0000000
--- a/dotfiles/nvim/lua/plugins/cmp.lua
+++ /dev/null
@@ -1,55 +0,0 @@
-return {
- "hrsh7th/nvim-cmp",
- dependencies = {
- "L3MON4D3/LuaSnip",
- "saadparwaiz1/cmp_luasnip",
- "hrsh7th/cmp-buffer",
- "hrsh7th/cmp-path",
- "hrsh7th/cmp-nvim-lsp",
- {
- "tamago324/cmp-zsh",
- config = function()
- require"cmp_zsh".setup {
- zshrc = true,
- filetypes = { "bash", "zsh", "sh" },
- }
- end,
- },
- "ray-x/cmp-treesitter",
- "hrsh7th/cmp-nvim-lua",
- "andersevenrud/cmp-tmux",
- },
- config = function()
- local cmp = require"cmp"
- cmp.setup {
- snippet = {
- expand = function(args)
- require"luasnip".lsp_expand(args.body)
- end,
- },
- view = {
- entries = "native",
- },
- mapping = cmp.mapping.preset.insert {
- [''] = cmp.mapping.select_prev_item(),
- [''] = cmp.mapping.select_next_item(),
- [''] = cmp.mapping.scroll_docs(4),
- [''] = cmp.mapping.scroll_docs(-4),
- [''] = cmp.mapping.complete(),
- [''] = cmp.mapping.confirm({ select = true }),
- [''] = cmp.mapping.abort(),
- },
- sources = {
- { name = "path" },
- { name = "luasnip" },
- { name = "zsh" },
- { name = "nvim_lsp" },
- { name = "buffer" },
- { name = "treesitter" },
- { name = "nvim-lua" },
- { name = "tmux" },
- },
- }
- end
-}
-
diff --git a/dotfiles/nvim/lua/plugins/comment.lua b/dotfiles/nvim/lua/plugins/comment.lua
deleted file mode 100644
index 72d3b83..0000000
--- a/dotfiles/nvim/lua/plugins/comment.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-return {
- "numToStr/Comment.nvim",
- opts = {},
- lazy = false
-}
diff --git a/dotfiles/nvim/lua/plugins/dressing.lua b/dotfiles/nvim/lua/plugins/dressing.lua
deleted file mode 100644
index 8d3e951..0000000
--- a/dotfiles/nvim/lua/plugins/dressing.lua
+++ /dev/null
@@ -1,7 +0,0 @@
-return {
- "stevearc/dressing.nvim",
- config = function()
- require"dressing".setup {
- }
- end
-}
diff --git a/dotfiles/nvim/lua/plugins/ibl.lua b/dotfiles/nvim/lua/plugins/ibl.lua
deleted file mode 100644
index fa22141..0000000
--- a/dotfiles/nvim/lua/plugins/ibl.lua
+++ /dev/null
@@ -1,11 +0,0 @@
-return {
- "lukas-reineke/indent-blankline.nvim",
- main = "ibl",
- opts = {},
- opts = {
- indent = {
- char = "▏"
- }
- }
-}
-
diff --git a/dotfiles/nvim/lua/plugins/init.lua b/dotfiles/nvim/lua/plugins/init.lua
deleted file mode 100644
index 9875d36..0000000
--- a/dotfiles/nvim/lua/plugins/init.lua
+++ /dev/null
@@ -1,22 +0,0 @@
-if vim.fn.executable("git") ~= 1 then
- vim.notify("git is not installed. Skipping plugins.", vim.log.levels.WARN)
- return
-end
-
-local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
-if not (vim.uv or vim.loop).fs_stat(lazypath) then
- vim.fn.system({
- "git",
- "clone",
- "--filter=blob:none",
- "https://github.com/folke/lazy.nvim.git",
- "--branch=stable", -- latest stable release
- lazypath,
- })
-end
-vim.opt.rtp:prepend(lazypath)
-
-plugins = require"util.require_dir"(vim.fn.stdpath("config").."/lua/plugins/", true)
-
-require"lazy".setup(plugins)
-
diff --git a/dotfiles/nvim/lua/plugins/kanagawa.lua b/dotfiles/nvim/lua/plugins/kanagawa.lua
deleted file mode 100644
index 06ffeb6..0000000
--- a/dotfiles/nvim/lua/plugins/kanagawa.lua
+++ /dev/null
@@ -1,49 +0,0 @@
-return {
- "rebelot/kanagawa.nvim",
- config = function()
- require"kanagawa".setup {
- theme = "dragon",
- background = {
- dark = "dragon",
- light = "lotus",
- },
- transparent = true,
- colors = {
- theme = {
- all = {
- ui = {
- bg_gutter = "none",
- },
- },
- },
- },
- overrides = function(colors)
- local theme = colors.theme
- return {
- NormalFloat = { bg = "none" },
- FloatBorder = { bg = "none" },
- FloatTitle = { bg = "none" },
-
- -- Save an hlgroup with dark background and dimmed foreground
- -- so that you can use it where your still want darker windows.
- -- E.g.: autocmd TermOpen * setlocal winhighlight=Normal:NormalDark
- NormalDark = { fg = theme.ui.fg_dim, bg = theme.ui.bg_m3 },
-
- -- Popular plugins that open floats will link to NormalFloat by default;
- -- set their background accordingly if you wish to keep them dark and borderless
- LazyNormal = { bg = theme.ui.bg_m3, fg = theme.ui.fg_dim },
- MasonNormal = { bg = theme.ui.bg_m3, fg = theme.ui.fg_dim },
- TelescopeTitle = { fg = theme.ui.special, bold = true },
- TelescopePromptNormal = { bg = theme.ui.bg_p1 },
- TelescopePromptBorder = { fg = theme.ui.bg_p1, bg = theme.ui.bg_p1 },
- TelescopeResultsNormal = { fg = theme.ui.fg_dim, bg = theme.ui.bg_m1 },
- TelescopeResultsBorder = { fg = theme.ui.bg_m1, bg = theme.ui.bg_m1 },
- TelescopePreviewNormal = { bg = theme.ui.bg_dim },
- TelescopePreviewBorder = { bg = theme.ui.bg_dim, fg = theme.ui.bg_dim },
- }
- end,
- }
- vim.cmd"colorscheme kanagawa"
- end
-}
-
diff --git a/dotfiles/nvim/lua/plugins/lsp/c.lua b/dotfiles/nvim/lua/plugins/lsp/c.lua
deleted file mode 100644
index c0a7c09..0000000
--- a/dotfiles/nvim/lua/plugins/lsp/c.lua
+++ /dev/null
@@ -1,8 +0,0 @@
-return function ()
- require"lspconfig".ccls.setup {
- capabilities = require"cmp_nvim_lsp".default_capabilities(),
- filetypes = {
- "c"
- }
- }
-end
diff --git a/dotfiles/nvim/lua/plugins/lsp/cxx.lua b/dotfiles/nvim/lua/plugins/lsp/cxx.lua
deleted file mode 100644
index 3560eb4..0000000
--- a/dotfiles/nvim/lua/plugins/lsp/cxx.lua
+++ /dev/null
@@ -1,8 +0,0 @@
-return function ()
- require"lspconfig".clangd.setup {
- capabilities = require"cmp_nvim_lsp".default_capabilities(),
- filetypes = {
- "cpp", "objc", "objcpp", "cuda", "proto"
- }
- }
-end
diff --git a/dotfiles/nvim/lua/plugins/lsp/haskell.lua b/dotfiles/nvim/lua/plugins/lsp/haskell.lua
deleted file mode 100644
index 7def886..0000000
--- a/dotfiles/nvim/lua/plugins/lsp/haskell.lua
+++ /dev/null
@@ -1,4 +0,0 @@
-return function()
- require"lspconfig".hls.setup {}
-end
-
diff --git a/dotfiles/nvim/lua/plugins/lsp/js.lua b/dotfiles/nvim/lua/plugins/lsp/js.lua
deleted file mode 100644
index 56d22a8..0000000
--- a/dotfiles/nvim/lua/plugins/lsp/js.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-return function ()
- require"lspconfig".ts_ls.setup {
- capabilities = require"cmp_nvim_lsp".default_capabilities()
- }
-end
diff --git a/dotfiles/nvim/lua/plugins/lsp/latex.lua b/dotfiles/nvim/lua/plugins/lsp/latex.lua
deleted file mode 100644
index 3ffe941..0000000
--- a/dotfiles/nvim/lua/plugins/lsp/latex.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-return function ()
- require"lspconfig".texlab.setup {
- capabilities = require"cmp_nvim_lsp".default_capabilities()
- }
-end
diff --git a/dotfiles/nvim/lua/plugins/lsp/lua.lua b/dotfiles/nvim/lua/plugins/lsp/lua.lua
deleted file mode 100644
index 3d7ad98..0000000
--- a/dotfiles/nvim/lua/plugins/lsp/lua.lua
+++ /dev/null
@@ -1,24 +0,0 @@
-return function()
- require'lspconfig'.lua_ls.setup {
- capabilities = require"cmp_nvim_lsp".default_capabilities(),
- on_init = function(client)
- local path = client.workspace_folders[1].name
- if vim.loop.fs_stat(path..'/.luarc.json') or vim.loop.fs_stat(path..'/.luarc.jsonc') then
- return
- end
-
- client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
- runtime = {
- version = 'LuaJIT'
- },
- workspace = {
- checkThirdParty = false,
- library = vim.api.nvim_get_runtime_file("", true)
- }
- })
- end,
- settings = {
- Lua = {}
- }
- }
-end
diff --git a/dotfiles/nvim/lua/plugins/lsp/nix.lua b/dotfiles/nvim/lua/plugins/lsp/nix.lua
deleted file mode 100644
index 6c326bd..0000000
--- a/dotfiles/nvim/lua/plugins/lsp/nix.lua
+++ /dev/null
@@ -1,6 +0,0 @@
-return function ()
- require"lspconfig".nil_ls.setup {
- capabilities = require"cmp_nvim_lsp".default_capabilities()
- }
-end
-
diff --git a/dotfiles/nvim/lua/plugins/lsp/php.lua b/dotfiles/nvim/lua/plugins/lsp/php.lua
deleted file mode 100644
index d45800c..0000000
--- a/dotfiles/nvim/lua/plugins/lsp/php.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-return function ()
- require"lspconfig".intelephense. setup {
- capabilities = require"cmp_nvim_lsp".default_capabilities(),
- }
-end
diff --git a/dotfiles/nvim/lua/plugins/lsp/python.lua b/dotfiles/nvim/lua/plugins/lsp/python.lua
deleted file mode 100644
index f8c2dcc..0000000
--- a/dotfiles/nvim/lua/plugins/lsp/python.lua
+++ /dev/null
@@ -1,10 +0,0 @@
-return function()
- require"lspconfig".basedpyright.setup {
- settings = {
- python = {
- pythonPath = vim.fn.exepath("python3"),
- },
- },
- }
-end
-
diff --git a/dotfiles/nvim/lua/plugins/lsp/rust.lua b/dotfiles/nvim/lua/plugins/lsp/rust.lua
deleted file mode 100644
index a320631..0000000
--- a/dotfiles/nvim/lua/plugins/lsp/rust.lua
+++ /dev/null
@@ -1,11 +0,0 @@
-return function()
- require"lspconfig".rust_analyzer.setup {
- settings = {
- ["rust-analyzer"] = {
- diagnostics = {
- enable = false,
- },
- },
- },
- }
-end
diff --git a/dotfiles/nvim/lua/plugins/lsp/shell.lua b/dotfiles/nvim/lua/plugins/lsp/shell.lua
deleted file mode 100644
index 72772f2..0000000
--- a/dotfiles/nvim/lua/plugins/lsp/shell.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-return function()
- require"lspconfig".bashls.setup {
- capabilities = require"cmp_nvim_lsp".default_capabilities(),
- }
-end
diff --git a/dotfiles/nvim/lua/plugins/lspconfig.lua b/dotfiles/nvim/lua/plugins/lspconfig.lua
deleted file mode 100644
index f764ee3..0000000
--- a/dotfiles/nvim/lua/plugins/lspconfig.lua
+++ /dev/null
@@ -1,29 +0,0 @@
-return {
- "neovim/nvim-lspconfig",
- config = function()
- local require_dir = require"util.require_dir"
- local lspees = require_dir(vim.fn.stdpath("config").."/lua/plugins/lsp/", "plugins.lsp")
- for _, lspee in ipairs(lspees) do
- lspee()
- end
-
- local map = require"util.map"
- local vlb = vim.lsp.buf
- local format = function()
- vlb.format { async = true }
- end
- vim.api.nvim_create_autocmd("LspAttach", {
- group = vim.api.nvim_create_augroup("UserLspConfig", {}),
- callback = function()
- map("n", "lgD", vlb.declaration, "[l]sp [g]o to [D]eclaration")
- map("n", "lgd", vlb.definition, "[l]sp [g]o to [d]definition")
- map("n", "lgi", vlb.implementation, "[l]sp [g]o to [i]mplementation")
- map("n", "lgr", vlb.references, "[l]sp [g]o to [r]eferences")
- map("n", "lh", vlb.hover, "[l]sp [h]over over selection")
- map("n", "lfm", format, "[l]sp [f]or[m]at file")
- map("n", "lca", vlb.code_action, "[l]sp [C]ode [a]ction")
- end,
- })
- end
-}
-
diff --git a/dotfiles/nvim/lua/plugins/lualine.lua b/dotfiles/nvim/lua/plugins/lualine.lua
deleted file mode 100644
index a54b7c5..0000000
--- a/dotfiles/nvim/lua/plugins/lualine.lua
+++ /dev/null
@@ -1,139 +0,0 @@
-return {
- "nvim-lualine/lualine.nvim",
- dependencies = {
- "nvim-tree/nvim-web-devicons",
- },
- config = function()
- -- Inspired by https://github.com/nvim-lualine/lualine.nvim/blob/master/examples/evil_lualine.lua
- local rgb_to_hex = require"util.rgb_to_hex"
- local hl = require"util.hl"
- local config = {
- options = {
- component_separators = "",
- section_separators = "",
- theme = {
- normal = {
- c = {
- fg = rgb_to_hex(hl("Normal").fg),
- bg = "none",
- },
- },
- inactive = {
- c = {
- fg = rgb_to_hex(hl("Normal").fg),
- bg = "none",
- },
- },
- },
- },
- sections = {
- lualine_a = {}, lualine_b = {}, lualine_y = {}, lualine_z = {}, -- Remove defaults
- lualine_c = {}, lualine_x = {}, -- Extend these later
- },
- inactive_sections = {
- lualine_a = {}, lualine_b = {}, lualine_c = {}, lualine_x = {}, lualine_y = {}, lualine_z = {},
- },
- }
-
- local function buffer_not_empty()
- return vim.fn.empty(vim.fn.expand("%:t")) ~= 1
- end
-
- local function ins_l(component)
- table.insert(config.sections.lualine_c, component)
- end
-
- local function ins_r(component)
- table.insert(config.sections.lualine_x, component)
- end
-
- local distro = require"util.get_distro"()
-
- ins_l {
- function()
- return "▊"
- end,
- padding = {
- left = 0,
- right = 0,
- },
- color = {
- fg = rgb_to_hex(hl("Comment").fg),
- },
- }
-
- ins_l {
- function()
- return distro.traits.icon
- end,
- color = {
- fg = distro.traits.color,
- },
- }
-
- ins_l {
- "filename",
- cond = buffer_not_empty,
- color = {
- fg = rgb_to_hex(hl("Operator").fg),
- }
- }
-
- ins_l {
- "filesize",
- cond = buffer_not_empty,
- }
-
- ins_l {
- "o:encoding",
- cond = buffer_not_empty,
- }
-
- ins_l {
- "fileformat",
- icons_enabled = false,
- cond = buffer_not_empty,
- }
-
- ins_r { "diagnostics" }
- ins_r { "diff" }
-
- ins_r {
- "branch",
- padding = {
- right = 0,
- },
- color = {
- fg = rgb_to_hex(hl("Constant").fg)
- }
- }
-
- ins_r {
- "location",
- }
-
- ins_r {
- "mode",
- fmt = string.lower,
- color = {
- fg = rgb_to_hex(hl("String").fg),
- }
- }
-
- ins_r {
- function()
- return "▊"
- end,
- padding = {
- left = 0,
- right = 0,
- },
- color = {
- fg = rgb_to_hex(hl("Comment").fg),
- }
- }
-
- require"lualine".setup(config)
- end
-}
-
diff --git a/dotfiles/nvim/lua/plugins/nvim-colorizer.lua b/dotfiles/nvim/lua/plugins/nvim-colorizer.lua
deleted file mode 100644
index 2fa30e4..0000000
--- a/dotfiles/nvim/lua/plugins/nvim-colorizer.lua
+++ /dev/null
@@ -1,6 +0,0 @@
-return {
- "norcalli/nvim-colorizer.lua",
- config = function()
- require"colorizer".setup()
- end,
-}
diff --git a/dotfiles/nvim/lua/plugins/telescope.lua b/dotfiles/nvim/lua/plugins/telescope.lua
deleted file mode 100644
index e93dbb0..0000000
--- a/dotfiles/nvim/lua/plugins/telescope.lua
+++ /dev/null
@@ -1,24 +0,0 @@
-return {
- "nvim-telescope/telescope.nvim",
- dependencies = { "nvim-lua/plenary.nvim" },
- config = function()
- require"telescope".setup {}
-
- local tb = require"telescope.builtin"
- local map = require"util.map"
-
- -- Default pickers
- map("n", "tf", tb.find_files,"[T]elescope [f]iles")
- map("n", "tg", tb.live_grep, "[T]elescope [g]rep")
- map("n", "tb", tb.buffers, "[T]elescope [b]uffers")
- map("n", "tm", function()
- tb.man_pages({ "ALL" })
- end, "[T]elescope [m]an pages")
- map("n", "tk", tb.keymaps, "[T]elescope [k]eymaps")
- map("n", "tk", tb.keymaps, "[T]elescope [k]eymaps")
-
- -- LSP pickers
- map("n", "tld", tb.diagnostics, "[T]elescope [l]sp [d]iagnostics")
- map("n", "tlr", tb.lsp_references, "[T]elescope [l]sp [r]eferences")
- end,
-}
diff --git a/dotfiles/nvim/lua/plugins/treesitter.lua b/dotfiles/nvim/lua/plugins/treesitter.lua
deleted file mode 100644
index e50163a..0000000
--- a/dotfiles/nvim/lua/plugins/treesitter.lua
+++ /dev/null
@@ -1,15 +0,0 @@
-return {
- "nvim-treesitter/nvim-treesitter",
- config = function()
- require"nvim-treesitter.configs".setup {
- ensure_installed = "all", -- pipebomb
- highlight = {
- enable = true,
- },
- indent = {
- enable = true,
- },
- }
- end,
- run = ":TSUpdate",
-}
diff --git a/dotfiles/nvim/lua/plugins/vimtex.lua b/dotfiles/nvim/lua/plugins/vimtex.lua
deleted file mode 100644
index d388535..0000000
--- a/dotfiles/nvim/lua/plugins/vimtex.lua
+++ /dev/null
@@ -1,8 +0,0 @@
-return {
- "lervag/vimtex",
- lazy = false,
- init = function()
- vim.g.vimtex_view_method = "zathura"
- end
-}
-
diff --git a/dotfiles/nvim/lua/settings/autocmds.lua b/dotfiles/nvim/lua/settings/autocmds.lua
deleted file mode 100644
index 471a38c..0000000
--- a/dotfiles/nvim/lua/settings/autocmds.lua
+++ /dev/null
@@ -1,37 +0,0 @@
-vim.api.nvim_create_autocmd("BufReadPost", {
- pattern = "*.h",
- callback = function()
- -- Toggle .h files between being interpreted as C and C++
- -- in case I have to work on a C++ header that was saved
- -- (incorrectly) as a C header file.
- vim.api.nvim_create_user_command("Fytwmmrt", function()
- if not vim.b.fu then
- vim.b.fu = true
- vim.bo.filetype = "cpp"
- vim.cmd([[
- LspStop ccls
- LspStart clangd
- ]])
- else
- vim.b.fu = false
- vim.bo.filetype = "c"
- vim.cmd([[
- LspStop ccls
- LspStart clangd
- ]])
- end
- end, { desc = "Fuck you to whoever made me run this."})
-
- -- Set all .h files to be interpreted as C by default instead
- -- of C++. If you use .h for your C++ headers instead of .hpp
- -- you should be ashamed of yourself and change and grow as a
- -- person as to not repeat such heretical offenses.
- if not vim.b.fu then
- vim.bo.filetype = "c"
- vim.cmd([[
- LspStop clangd
- LspStart ccls
- ]])
- end
- end,
-})
diff --git a/dotfiles/nvim/lua/settings/init.lua b/dotfiles/nvim/lua/settings/init.lua
deleted file mode 100644
index 9bb29a0..0000000
--- a/dotfiles/nvim/lua/settings/init.lua
+++ /dev/null
@@ -1,3 +0,0 @@
-require"settings.options"
-require"settings.autocmds"
-require"settings.keymaps"
diff --git a/dotfiles/nvim/lua/settings/keymaps.lua b/dotfiles/nvim/lua/settings/keymaps.lua
deleted file mode 100644
index 56c002f..0000000
--- a/dotfiles/nvim/lua/settings/keymaps.lua
+++ /dev/null
@@ -1,7 +0,0 @@
-local map = require"util.map"
-
-map("n", "", "", "Mapleader")
-vim.g.mapleader = " "
-
-map("n", "df", vim.diagnostic.open_float, "[D]iagnostics [f]loat")
-
diff --git a/dotfiles/nvim/lua/settings/options.lua b/dotfiles/nvim/lua/settings/options.lua
deleted file mode 100644
index 99c1318..0000000
--- a/dotfiles/nvim/lua/settings/options.lua
+++ /dev/null
@@ -1,28 +0,0 @@
-local options = {
- tabstop = 4,
- softtabstop = 4,
- shiftwidth = 4,
- expandtab = true,
- number = true,
- relativenumber = true,
- fileencoding = "utf-8",
- cursorline = true,
- wrap = false,
- signcolumn = "yes",
- swapfile = false,
- errorbells = false,
- undofile = true,
- incsearch = true,
- hlsearch = false,
- backup = false,
- termguicolors = true,
- scrolloff = 8,
- sidescrolloff = 8,
-}
-
-for option, value in pairs(options) do
- pcall(function()
- vim.opt[option] = value
- end)
-end
-
diff --git a/dotfiles/nvim/lua/util/get_distro.lua b/dotfiles/nvim/lua/util/get_distro.lua
deleted file mode 100644
index 7bc39a8..0000000
--- a/dotfiles/nvim/lua/util/get_distro.lua
+++ /dev/null
@@ -1,73 +0,0 @@
-local function distro_traits(name)
- local icons = {
- [ "unknown" ] = {
- icon = "",
- color = "#f3be25",
- },
- [ "debian" ] = {
- icon = "",
- color = "#d70a53",
- },
- [ "gentoo" ] = {
- icon = "",
- color = "#54487A",
- },
- [ "nixos" ] = {
- icon = "",
- color = "#5277C3",
- },
- [ "\"opensuse-tumbleweed\"" ] = {
- icon = "",
- color = "#73ba25",
- },
- }
-
- if os.getenv("CONTAINER_ID") ~= nil then
- icons["distrobox"] = {
- icon = "[ " .. os.getenv("CONTAINER_ID") .. "]",
- color = "#917d62",
- }
- end
-
- local icon = icons[name]
- if icon == nil then
- icon = icons["unknown"]
- end
-
- return icon
-end
-
-return function()
- if os.getenv("CONTAINER_ID") ~= nil then
- return {
- name = "distrobox",
- traits = distro_traits("distrobox"),
- }
- end
-
- local release_file = io.open("/etc/os-release", "rb")
- if release_file == nil then
- return {
- name = "unknown",
- traits = distro_traits("unknown"),
- }
- end
-
- local content = vim.split(release_file:read("*a"), "\n")
- local distro_id = nil
- for _, line in ipairs(content) do
- if string.sub(line, 0, 3) == "ID=" then
- distro_id = string.sub(line, 4, -1)
- goto distro_id_found
- end
- end
- ::distro_id_found::
-
- release_file:close()
-
- return {
- name = distro_id,
- traits = distro_traits(distro_id)
- }
-end
-
diff --git a/dotfiles/nvim/lua/util/hl.lua b/dotfiles/nvim/lua/util/hl.lua
deleted file mode 100644
index d7c95c1..0000000
--- a/dotfiles/nvim/lua/util/hl.lua
+++ /dev/null
@@ -1,7 +0,0 @@
-return function (name)
- local hl = vim.api.nvim_get_hl(0, { name = name })
- while hl.link ~= nil do
- hl = vim.api.nvim_get_hl(0, { name = hl.link })
- end
- return hl
-end
diff --git a/dotfiles/nvim/lua/util/map.lua b/dotfiles/nvim/lua/util/map.lua
deleted file mode 100644
index 26d4468..0000000
--- a/dotfiles/nvim/lua/util/map.lua
+++ /dev/null
@@ -1,9 +0,0 @@
-return function(mode, key, mapping, comment)
- local opts = {
- noremap = true,
- silent = true,
- desc = comment
- }
- vim.keymap.set(mode, key, mapping, opts)
-end
-
diff --git a/dotfiles/nvim/lua/util/require_dir.lua b/dotfiles/nvim/lua/util/require_dir.lua
deleted file mode 100644
index 11b39af..0000000
--- a/dotfiles/nvim/lua/util/require_dir.lua
+++ /dev/null
@@ -1,27 +0,0 @@
-return function(dir, skip_init)
- local returns = {}
- local lua_files = vim.split(vim.fn.glob(dir.."/*.lua"), "\n")
- local namespace = string.gsub(dir, vim.fn.stdpath("config").."/lua/", "")
- namespace = string.gsub(namespace, "%/", ".")
-
- for _, file in ipairs(lua_files) do
- file = string.gsub(file, "%.lua", "")
- file = string.gsub(file, dir.."/", namespace)
-
- if skip_init and file == namespace.."init" then
- goto continue
- end
-
- local require_ok, require_return = pcall(require, file)
- if require_ok then
- table.insert(returns, require_return)
- else
- vim.notify("Could not require file: '"..file.."': "..require_return, vim.log.levels.WARNING)
- end
-
- ::continue::
- end
-
- return returns
-end
-
diff --git a/dotfiles/nvim/lua/util/rgb_to_hex.lua b/dotfiles/nvim/lua/util/rgb_to_hex.lua
deleted file mode 100644
index 33bd99d..0000000
--- a/dotfiles/nvim/lua/util/rgb_to_hex.lua
+++ /dev/null
@@ -1,11 +0,0 @@
-return function(rgb)
- if rgb == nil then
- return nil
- end
-
- local r = string.format("%02x", (rgb / 65536) % 256)
- local g = string.format("%02x", (rgb / 256) % 256)
- local b = string.format("%02x", rgb % 256)
-
- return "#"..r..g..b
-end
diff --git a/dotfiles/zsh/.zshrc b/dotfiles/zsh/.zshrc
deleted file mode 100755
index d468434..0000000
--- a/dotfiles/zsh/.zshrc
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env zsh
-
-# Prefetch paths
-source "$ZDOTDIR/conf.d/path.zsh"
-
-for file in $ZDOTDIR/conf.d/*; do
- if [[ "$file" == *"path.zsh" ]]; then
- continue
- fi
- source "$file"
-done
-
diff --git a/dotfiles/zsh/conf.d/alias.zsh b/dotfiles/zsh/conf.d/alias.zsh
deleted file mode 100644
index 5079bde..0000000
--- a/dotfiles/zsh/conf.d/alias.zsh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env zsh
-
-alias reload="exec zsh"
-
-if [ -x "$(command -v nix)" ]; then
- alias nix-develop="nix develop -c $SHELL"
-fi
-
diff --git a/dotfiles/zsh/conf.d/color.zsh b/dotfiles/zsh/conf.d/color.zsh
deleted file mode 100755
index e1de862..0000000
--- a/dotfiles/zsh/conf.d/color.zsh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env zsh
-
-alias ls='ls --color=auto'
-alias ll='ls -lah --color=auto'
-alias grep='grep --color=auto'
-
-term_name=$(ps -o comm= "$PPID")
-if [ "$term_name" = "xterm" ] && [ -n "$(command -v "transset")" ]; then
- transset -a 0.95 > /dev/null
-fi
-
diff --git a/dotfiles/zsh/conf.d/completions.zsh b/dotfiles/zsh/conf.d/completions.zsh
deleted file mode 100755
index a367270..0000000
--- a/dotfiles/zsh/conf.d/completions.zsh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env zsh
-
-if [ -z "$FZF_TAB_PLUGIN" ]; then
- if [ ! -d "$HOME/.cache/fzf-tab" ]; then
- echo "Installing fzf-tab"
- git clone "https://github.com/Aloxaf/fzf-tab" "$HOME/.cache/fzf-tab"
- fi
- FZF_TAB_PLUGIN="$HOME/.cache/fzf-tab/fzf-tab.plugin.zsh"
-fi
-
-autoload -Uz compinit
-compinit
-
-source "$FZF_TAB_PLUGIN"
-zstyle ':completion:*:git-checkout:*' sort false
-
-if [ -n "$TMUX" ]; then
- zstyle ':fzf-tab:*' fzf-command ftb-tmux-popup
-fi
-
diff --git a/dotfiles/zsh/conf.d/distrobox.zsh b/dotfiles/zsh/conf.d/distrobox.zsh
deleted file mode 100644
index 1f4e6e4..0000000
--- a/dotfiles/zsh/conf.d/distrobox.zsh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env zsh
-
-# TODO: Script to prompt which environment the user wants to enter in to
diff --git a/dotfiles/zsh/conf.d/env.zsh b/dotfiles/zsh/conf.d/env.zsh
deleted file mode 100755
index 5e7d8a7..0000000
--- a/dotfiles/zsh/conf.d/env.zsh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/env zsh
-
-if [ -n "$(command -v qt5ct)" ] && [ -z "$DESKTOP_SESSION" ]; then
- export QT_QPA_PLATFORMTHEME=qt5ct
-fi
-
diff --git a/dotfiles/zsh/conf.d/fuck.zsh b/dotfiles/zsh/conf.d/fuck.zsh
deleted file mode 100755
index de46864..0000000
--- a/dotfiles/zsh/conf.d/fuck.zsh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env zsh
-
-if [ -n "$(command -v thefuck)" ]; then
- fuck() {
- eval $(thefuck --alias)
- fuck
- }
-fi
-
diff --git a/dotfiles/zsh/conf.d/gpg.zsh b/dotfiles/zsh/conf.d/gpg.zsh
deleted file mode 100755
index a4bb94b..0000000
--- a/dotfiles/zsh/conf.d/gpg.zsh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env zsh
-
-GPG_TTY=$(tty)
-export GPG_TTY
-
diff --git a/dotfiles/zsh/conf.d/manpager.zsh b/dotfiles/zsh/conf.d/manpager.zsh
deleted file mode 100755
index ef34d2a..0000000
--- a/dotfiles/zsh/conf.d/manpager.zsh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env zsh
-
-if [ -n "$(command -v "nvim")" ]; then
- export MANPAGER='nvim +Man!'
- export EDITOR="nvim"
-fi
-
diff --git a/dotfiles/zsh/conf.d/nix.zsh b/dotfiles/zsh/conf.d/nix.zsh
deleted file mode 100644
index 8caaafc..0000000
--- a/dotfiles/zsh/conf.d/nix.zsh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env zsh
-
-# Nix specific zsh configuration
-if [ -x "$(command -v nix)" ]; then
- source "$NIX_SHELL_PLUGIN"
- if [ -f "$HOME/.config/user-dirs.dirs" ]; then
- source "$HOME/.config/user-dirs.dirs"
- fi
-fi
-
-
diff --git a/dotfiles/zsh/conf.d/path.zsh b/dotfiles/zsh/conf.d/path.zsh
deleted file mode 100755
index c418f2c..0000000
--- a/dotfiles/zsh/conf.d/path.zsh
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env zsh
-
-add_to_path() {
- if [ -d "$1" ] && [[ "$PATH" != *"$1"* ]]; then
- PATH="$PATH:$1"
- fi
-}
-
-add_to_path "$HOME/.local/bin"
-
-if [ -f "/etc/profile.d/nix.sh" ]; then
- source /etc/profile.d/nix.sh
-fi
-
-# Language package mangers
-if [ -n "$(command -v go)" ]; then
- export GOPATH="$HOME/.local/share/go"
- add_to_path "$HOME/.local/share/go/bin"
-fi
-
-if [ -n "$(command -v npm)" ]; then
- if [ -f "$HOME/.npmrc" ]; then
- if [ -z "$(grep prefix "$HOME/.npmrc")" ]; then
- npm config set prefix "$HOME/.local/share/npm"
- fi
- else
- npm config set prefix "$HOME/.local/share/npm"
- fi
- add_to_path "$HOME/.local/share/npm/bin"
-fi
-
-if [ -n "$(command -v cargo)" ]; then
- export CARGO_HOME="$HOME/.local/share/cargo"
- add_to_path "$HOME/.local/share/cargo/bin"
-fi
-
-if [ -n "$(command -v pip3)" ] && [ -n "$(command -v virtualenv)" ]; then
- if [ ! -d "$HOME/.local/share/python3-venv" ]; then
- python3 -m venv "$HOME/.local/share/python3-venv"
- fi
-
- if [ "$(grep "executable" "$HOME/.local/share/python3-venv/pyvenv.cfg" | awk '{print $3}')" \
- != "$(realpath $(command -v python3))" ]; then
- python3 -m venv --upgrade "$HOME/.local/share/python3-venv"
- fi
-
- export VIRTUAL_ENV_DISABLE_PROMPT=true
- source "$HOME/.local/share/python3-venv/bin/activate"
-fi
-
diff --git a/dotfiles/zsh/conf.d/ps1.zsh b/dotfiles/zsh/conf.d/ps1.zsh
deleted file mode 100755
index 1155fb2..0000000
--- a/dotfiles/zsh/conf.d/ps1.zsh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env zsh
-
-distro=$(cat /etc/os-release | grep -w 'ID=.*' | sed -e 's/ID=//g' | awk '{print $1}')
-case "$distro" in
- "debian") dicon="%F{red}%f" ;;
- "gentoo") dicon="%F{magenta}%f" ;;
- "\"opensuse-tumbleweed\"") dicon="%F{green} %f" ;;
- "nixos") dicon="%F{cyan}%f" ;;
- *) dicon="%F{yellow}[]%f" ;;
-esac
-
-if [ -n "$IN_NIX_SHELL" ]; then
- if [ -z "$NIX_SHELL_PACKAGES" ]; then
- nix_shell_ps1=" %F{red}nix-shell%f"
- else
- nix_shell_ps1=" %F{red}{ $NIX_SHELL_PACKAGES }%f"
- fi
-else
- nix_shell_ps1=""
-fi
-
-if [ -n "$CONTAINER_ID" ]; then
- dicon="%F{bg-yellow}[ $CONTAINER_ID]%f"
-fi
-
-setopt prompt_subst
-autoload -Uz vcs_info
-precmd () { vcs_info }
-zstyle ':vcs_info:*' formats ' %F{yellow}(%b)%f'
-
-NL=$'\n'
-export PS1='[$dicon %F{green}%3~%f$vcs_info_msg_0_$nix_shell_ps1]# '
-
diff --git a/dotfiles/zsh/conf.d/ssh.zsh b/dotfiles/zsh/conf.d/ssh.zsh
deleted file mode 100755
index 7e2231f..0000000
--- a/dotfiles/zsh/conf.d/ssh.zsh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env zsh
-
-if [ -z "$DESKTOP_SESSION" ]; then
- if [ -n "$(command -v gnome-keyring-daemon)" ]; then
- if [ -z "$(pidof gnome-keyring-daemon)" ]; then
- eval $(gnome-keyring-daemon --start)
- export SSH_AUTH_SOCK
- fi
- else
- { eval $(ssh-agent -s); } > /dev/null 2>&1
- fi
-fi
-
diff --git a/dotfiles/zsh/conf.d/suggestions.zsh b/dotfiles/zsh/conf.d/suggestions.zsh
deleted file mode 100755
index 1325a7b..0000000
--- a/dotfiles/zsh/conf.d/suggestions.zsh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env zsh
-
-export HISTFILE=~/.cache/zsh_history
-export HISTSIZE=10000
-export SAVEHIST=$HISTSIZE
-
-setopt INC_APPEND_HISTORY
-setopt SHARE_HISTORY
-setopt HIST_IGNORE_SPACE
-setopt HIST_SAVE_NO_DUPS
-
-if [ -z "$AUTOSUGGEST_PLUGIN" ]; then
- import_file="/usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
-else
- import_file="$AUTOSUGGEST_PLUGIN"
-fi
-
-if [ ! -f "$import_file" ]; then
- if [ ! -d "$HOME/.cache/zsh-autosuggestions" ]; then
- echo "Installing zsh-autosuggestions..."
- git clone "https://github.com/zsh-users/zsh-autosuggestions.git" "$HOME/.cache/zsh-autosuggestions"
- fi
- import_file="$HOME/.cache/zsh-autosuggestions/zsh-autosuggestions.zsh"
-fi
-
-source "$import_file"
-
-ZSH_AUTOSUGGEST_STRATEGY=(history completion)
-
diff --git a/dotfiles/zsh/conf.d/syntax.zsh b/dotfiles/zsh/conf.d/syntax.zsh
deleted file mode 100755
index 752aec3..0000000
--- a/dotfiles/zsh/conf.d/syntax.zsh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env zsh
-
-if [ -z "$SYNTAX_PLUGIN" ]; then
- import_file="/usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
-else
- import_file="$SYNTAX_PLUGIN"
-fi
-
-if [ ! -f "$import_file" ]; then
- if [ ! -d "$HOME/.cache/zsh-syntax-highlighting" ]; then
- echo "Installing zsh-syntax-highlighting..."
- git clone "https://github.com/zsh-users/zsh-syntax-highlighting.git" "$HOME/.cache/zsh-syntax-highlighting"
- fi
- import_file="$HOME/.cache/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
-fi
-
-source "$import_file"
-
diff --git a/flake.lock b/flake.lock
index c353b96..d01e7fa 100644
--- a/flake.lock
+++ b/flake.lock
@@ -1,39 +1,87 @@
{
"nodes": {
- "aagl": {
+ "disko": {
"inputs": {
- "flake-compat": "flake-compat",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
- "lastModified": 1734540176,
- "narHash": "sha256-msxbnOw/nh8GJ87YtBEDT1jhVldOBtxHRF2KgvYPeDA=",
- "owner": "ezKEa",
- "repo": "aagl-gtk-on-nix",
- "rev": "00df3ad02364a6fb8f1105dc72ae770b748c62eb",
+ "lastModified": 1736864502,
+ "narHash": "sha256-ItkIZyebGvNH2dK9jVGzJHGPtb6BSWLN8Gmef16NeY0=",
+ "owner": "nix-community",
+ "repo": "disko",
+ "rev": "0141aabed359f063de7413f80d906e1d98c0c123",
"type": "github"
},
"original": {
- "owner": "ezKEa",
- "repo": "aagl-gtk-on-nix",
+ "owner": "nix-community",
+ "ref": "latest",
+ "repo": "disko",
"type": "github"
}
},
- "flake-compat": {
- "flake": false,
+ "flake-parts": {
+ "inputs": {
+ "nixpkgs-lib": "nixpkgs-lib"
+ },
"locked": {
- "lastModified": 1733328505,
- "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
- "owner": "edolstra",
- "repo": "flake-compat",
- "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
+ "lastModified": 1736143030,
+ "narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=",
+ "owner": "hercules-ci",
+ "repo": "flake-parts",
+ "rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de",
"type": "github"
},
"original": {
- "owner": "edolstra",
- "repo": "flake-compat",
+ "owner": "hercules-ci",
+ "repo": "flake-parts",
+ "type": "github"
+ }
+ },
+ "flake-parts_2": {
+ "inputs": {
+ "nixpkgs-lib": [
+ "nixpak",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1736143030,
+ "narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=",
+ "owner": "hercules-ci",
+ "repo": "flake-parts",
+ "rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de",
+ "type": "github"
+ },
+ "original": {
+ "owner": "hercules-ci",
+ "repo": "flake-parts",
+ "type": "github"
+ }
+ },
+ "hercules-ci-effects": {
+ "inputs": {
+ "flake-parts": [
+ "nixpak",
+ "flake-parts"
+ ],
+ "nixpkgs": [
+ "nixpak",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1736917206,
+ "narHash": "sha256-JTBWmyGf8K1Rwb+gviHIUzRJk/sITtT+72HXFkTZUjo=",
+ "owner": "hercules-ci",
+ "repo": "hercules-ci-effects",
+ "rev": "afd0a42e8c61ebb56899315ee4084a8b2e4ff425",
+ "type": "github"
+ },
+ "original": {
+ "owner": "hercules-ci",
+ "repo": "hercules-ci-effects",
"type": "github"
}
},
@@ -44,26 +92,27 @@
]
},
"locked": {
- "lastModified": 1736204492,
- "narHash": "sha256-CoBPRgkUex9Iz6qGSzi/BFVUQjndB0PmME2B6eEyeCs=",
+ "lastModified": 1736373539,
+ "narHash": "sha256-dinzAqCjenWDxuy+MqUQq0I4zUSfaCvN9rzuCmgMZJY=",
"owner": "nix-community",
"repo": "home-manager",
- "rev": "20665c6efa83d71020c8730f26706258ba5c6b2a",
+ "rev": "bd65bc3cde04c16755955630b344bc9e35272c56",
"type": "github"
},
"original": {
"owner": "nix-community",
+ "ref": "release-24.11",
"repo": "home-manager",
"type": "github"
}
},
"impermanence": {
"locked": {
- "lastModified": 1734945620,
- "narHash": "sha256-olIfsfJK4/GFmPH8mXMmBDAkzVQ1TWJmeGT3wBGfQPY=",
+ "lastModified": 1737831083,
+ "narHash": "sha256-LJggUHbpyeDvNagTUrdhe/pRVp4pnS6wVKALS782gRI=",
"owner": "nix-community",
"repo": "impermanence",
- "rev": "d000479f4f41390ff7cf9204979660ad5dd16176",
+ "rev": "4b3e914cdf97a5b536a889e939fb2fd2b043a170",
"type": "github"
},
"original": {
@@ -72,13 +121,35 @@
"type": "github"
}
},
+ "nixpak": {
+ "inputs": {
+ "flake-parts": "flake-parts_2",
+ "hercules-ci-effects": "hercules-ci-effects",
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1737599681,
+ "narHash": "sha256-sFzfMxH7c9UWyrFsC2wsPRJqTCHchz7q2zd04+9/yvw=",
+ "owner": "nixpak",
+ "repo": "nixpak",
+ "rev": "68beced51b937d506187431bec4847e78fd34911",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nixpak",
+ "repo": "nixpak",
+ "type": "github"
+ }
+ },
"nixpkgs": {
"locked": {
- "lastModified": 1736061677,
- "narHash": "sha256-DjkQPnkAfd7eB522PwnkGhOMuT9QVCZspDpJJYyOj60=",
+ "lastModified": 1737885640,
+ "narHash": "sha256-GFzPxJzTd1rPIVD4IW+GwJlyGwBDV1Tj5FLYwDQQ9sM=",
"owner": "nixos",
"repo": "nixpkgs",
- "rev": "cbd8ec4de4469333c82ff40d057350c30e9f7d36",
+ "rev": "4e96537f163fad24ed9eb317798a79afc85b51b7",
"type": "github"
},
"original": {
@@ -88,36 +159,80 @@
"type": "github"
}
},
- "plasma-manager": {
- "inputs": {
- "home-manager": [
- "home-manager"
- ],
- "nixpkgs": [
- "nixpkgs"
- ]
- },
+ "nixpkgs-lib": {
"locked": {
- "lastModified": 1735049224,
- "narHash": "sha256-fWUd9kyXdepphJ7cCzOsuSo7l0kbFCkUqfgKqZyFZzE=",
- "owner": "nix-community",
- "repo": "plasma-manager",
- "rev": "d16bbded0ae452bc088489e7dca3ef58d8d1830b",
+ "lastModified": 1735774519,
+ "narHash": "sha256-CewEm1o2eVAnoqb6Ml+Qi9Gg/EfNAxbRx1lANGVyoLI=",
+ "type": "tarball",
+ "url": "https://github.com/NixOS/nixpkgs/archive/e9b51731911566bbf7e4895475a87fe06961de0b.tar.gz"
+ },
+ "original": {
+ "type": "tarball",
+ "url": "https://github.com/NixOS/nixpkgs/archive/e9b51731911566bbf7e4895475a87fe06961de0b.tar.gz"
+ }
+ },
+ "nixpkgs-unstable": {
+ "locked": {
+ "lastModified": 1737885589,
+ "narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=",
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8",
"type": "github"
},
"original": {
- "owner": "nix-community",
- "repo": "plasma-manager",
+ "owner": "nixos",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
- "aagl": "aagl",
+ "disko": "disko",
+ "flake-parts": "flake-parts",
"home-manager": "home-manager",
"impermanence": "impermanence",
+ "nixpak": "nixpak",
"nixpkgs": "nixpkgs",
- "plasma-manager": "plasma-manager"
+ "nixpkgs-unstable": "nixpkgs-unstable",
+ "secrets": "secrets",
+ "sops-nix": "sops-nix"
+ }
+ },
+ "secrets": {
+ "locked": {
+ "lastModified": 1737589360,
+ "narHash": "sha256-s4tCUlvzXpQQ1wJ7ZcslfVuszmQlmnp7bnoZRdnBZuw=",
+ "ref": "refs/heads/master",
+ "rev": "2cfed436d84594b4d4a73843095c75c644628dfe",
+ "revCount": 4,
+ "type": "git",
+ "url": "ssh://git@git.caem.dev/caem/secrets.git"
+ },
+ "original": {
+ "type": "git",
+ "url": "ssh://git@git.caem.dev/caem/secrets.git"
+ }
+ },
+ "sops-nix": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1737411508,
+ "narHash": "sha256-j9IdflJwRtqo9WpM0OfAZml47eBblUHGNQTe62OUqTw=",
+ "owner": "Mic92",
+ "repo": "sops-nix",
+ "rev": "015d461c16678fc02a2f405eb453abb509d4e1d4",
+ "type": "github"
+ },
+ "original": {
+ "owner": "Mic92",
+ "repo": "sops-nix",
+ "type": "github"
}
}
},
diff --git a/flake.nix b/flake.nix
index 2bcbf6e..78fc90a 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,49 +1,71 @@
{
+ description = "My NixOS configuration files.";
+
inputs = {
+ secrets.url = "git+ssh://git@git.caem.dev/caem/secrets.git";
+
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
+ nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
+
+ flake-parts.url = "github:hercules-ci/flake-parts";
+
+ home-manager = {
+ url = "github:nix-community/home-manager/release-24.11";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
impermanence.url = "github:nix-community/impermanence";
- home-manager = {
- url = "github:nix-community/home-manager";
+ disko = {
+ url = "github:nix-community/disko/latest";
inputs.nixpkgs.follows = "nixpkgs";
};
- plasma-manager = {
- url = "github:nix-community/plasma-manager";
+ sops-nix = {
+ url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
- inputs.home-manager.follows = "home-manager";
};
- aagl = {
- url = "github:ezKEa/aagl-gtk-on-nix";
+ nixpak = {
+ url = "github:nixpak/nixpak";
inputs.nixpkgs.follows = "nixpkgs";
};
};
- outputs = {
+ outputs = {
nixpkgs,
+ nixpkgs-unstable,
+ flake-parts,
impermanence,
home-manager,
- plasma-manager,
- aagl,
+ disko,
+ sops-nix,
+ secrets,
+ nixpak,
...
} @ inputs: let
- lib = nixpkgs.lib.extend (final: prev:
+ lib = nixpkgs.lib.extend (final: prev:
import ./lib { lib = final; }
);
in {
nixosConfigurations = lib.mkHosts {
- modules = [
- home-manager.nixosModules.home-manager {
- home-manager.sharedModules = [
- plasma-manager.homeManagerModules.plasma-manager
- ];
- }
- impermanence.nixosModules.impermanence
- ];
nixpkgs = nixpkgs;
inputs = inputs;
+ user = "caem";
+ modules = [
+ impermanence.nixosModules.impermanence
+ disko.nixosModules.disko
+ sops-nix.nixosModules.sops
+ home-manager.nixosModules.home-manager {
+ home-manager = {
+ useGlobalPkgs = true;
+ useUserPackages = true;
+ extraSpecialArgs = {
+ inherit inputs;
+ };
+ };
+ }
+ ];
};
};
}
diff --git a/home/default.nix b/home/default.nix
deleted file mode 100644
index 30ba60d..0000000
--- a/home/default.nix
+++ /dev/null
@@ -1,39 +0,0 @@
-{ config, ... }:
-
-{
- users.users.hu = {
- isNormalUser = true;
- extraGroups = [ "wheel" ];
- hashedPasswordFile = "/nix/config/secrets/pass";
- };
-
- home-manager = {
- useGlobalPkgs = true;
- useUserPackages = true;
- users.hu = {
- home.username = "hu";
- home.homeDirectory = "/home/hu";
- home.stateVersion = config.system.stateVersion;
-
- xdg = {
- enable = true;
- userDirs = {
- documents = "/home/hu/documents";
- download = "/home/hu/download";
- music = "/home/hu/music";
- pictures = "/home/hu/images";
- videos = "/home/hu/videos";
-
- # I will never need this so they're getting hidden
- publicShare = "/home/hu/.local/share/xdg/public";
- templates = "/home/hu/.local/share/xdg/templates";
- };
- };
- };
- };
-
- imports = [
- ./persist.nix
- ];
-}
-
diff --git a/home/persist.nix b/home/persist.nix
deleted file mode 100644
index 68a3a2a..0000000
--- a/home/persist.nix
+++ /dev/null
@@ -1,24 +0,0 @@
-{ ... }:
-
-{
- environment.persistence."/nix/persist".users.hu = {
- directories = [
- "archives"
- "documents"
- "programming"
- "source"
- "games"
- "images"
- "videos"
-
- # Program files
- { directory = ".gnupg"; mode = "0700"; }
- { directory = ".ssh"; mode = "0700"; }
- { directory = ".nixops"; mode = "0700"; }
- { directory = ".local/share/keyrings"; mode = "0700"; }
- { directory = ".pki"; mode = "0700"; }
- ".local/share/direnv"
- ];
- };
-}
-
diff --git a/hosts/puter/default.nix b/hosts/puter/default.nix
new file mode 100644
index 0000000..929164b
--- /dev/null
+++ b/hosts/puter/default.nix
@@ -0,0 +1,63 @@
+{ pkgs, lib, username, ... }:
+
+{
+ imports = [
+ ./disko.nix
+ ./packages.nix
+ ];
+
+ time.timeZone = "Europe/Berlin";
+
+ networking = {
+ hostName = "puter";
+ useDHCP = lib.mkDefault true;
+ };
+
+ boot = {
+ loader = {
+ efi.canTouchEfiVariables = true;
+ grub = {
+ enable = true;
+ # Keep "nodev" for efi systems
+ device = "nodev";
+ efiSupport = true;
+ gfxmodeEfi = "1920x1080";
+ };
+ };
+
+ tmp.useTmpfs = true;
+ kernelPackages = pkgs.linuxPackages_xanmod_latest;
+ supportedFilesystems = [ "btfs" "vfat" "xfs" ];
+ initrd = {
+ availableKernelModules = [ "nvme" "xhci_pci" "ahci"
+ "usbhid" "usb_storage" "sd_mod" ];
+ };
+ };
+
+ services = {
+ fstrim.enable = true;
+ btrfs.autoScrub.enable = true;
+ };
+
+ fileSystems = {
+ # These are system specific. If you have any additional drives that are not
+ # your root device you can add and mount them here. Added nofail so that you can
+ # install this configuration on a device without it exploding when you don't have
+ # these specific partitions.
+
+ "/home/${username}/mounts/vault" = {
+ device = "/dev/disk/by-uuid/048d175b-0e3e-4ec7-955b-3d9a45f9f237";
+ options = [ "nofail" ];
+ fsType = "xfs";
+ };
+
+ "/home/${username}/mounts/attic" = {
+ device = "/dev/disk/by-uuid/ec32ce36-9f53-4f44-ac8f-2c9163f0b3d7";
+ options = [ "nofail" ];
+ fsType = "xfs";
+ };
+ };
+
+ system.stateVersion = "24.11"; # [managed by install.sh] { state version }
+}
+
diff --git a/hosts/puter/disko.nix b/hosts/puter/disko.nix
new file mode 100644
index 0000000..cc83a35
--- /dev/null
+++ b/hosts/puter/disko.nix
@@ -0,0 +1,58 @@
+{ ... }:
+
+{
+ disko.devices = {
+ disk = {
+ master = {
+ type = "disk";
+ device = "/dev/nvme0n1"; # [managed by install.sh]
+ content = {
+ type = "gpt";
+ partitions = {
+ efi = {
+ priority = 1;
+ name = "efi";
+ start = "1M";
+ end = "1024M";
+ type = "EF00";
+ content = {
+ type = "filesystem";
+ format = "vfat";
+ mountpoint = "/boot";
+ mountOptions = [
+ "umask=0077"
+ "noatime"
+ ];
+ };
+ };
+ root = {
+ size = "100%";
+ content = {
+ type = "btrfs";
+ extraArgs = [ "-f" "-L nixos" ];
+ subvolumes = {
+ /* Do not rename the root partition as it'll break impermanence */
+ "/root" = {
+ mountpoint = "/";
+ mountOptions = [
+ "noatime"
+ "compress=zstd"
+ ];
+ };
+
+ "/nix" = {
+ mountpoint = "/nix";
+ mountOptions = [
+ "noatime"
+ "compress=zstd"
+ ];
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+}
diff --git a/hosts/puter/packages.nix b/hosts/puter/packages.nix
new file mode 100644
index 0000000..4eb305f
--- /dev/null
+++ b/hosts/puter/packages.nix
@@ -0,0 +1,17 @@
+{ ... }:
+
+{
+ imports = let
+ modules = ../../modules/nixos;
+ in [
+ "${modules}/core"
+ "${modules}/hardware/audio"
+ "${modules}/hardware/gpu/nvidia"
+ "${modules}/hardware/cpu/amd"
+ "${modules}/multimedia"
+ "${modules}/desktop/gnome"
+ "${modules}/communication"
+ "${modules}/development"
+ ];
+}
+
diff --git a/hosts/vm/default.nix b/hosts/vm/default.nix
new file mode 100644
index 0000000..c9dd956
--- /dev/null
+++ b/hosts/vm/default.nix
@@ -0,0 +1,49 @@
+{ pkgs, lib, modulesPath, ... }:
+
+{
+ imports = [
+ ./disko.nix
+ ./packages.nix
+ (modulesPath + "/profiles/qemu-guest.nix")
+ ];
+
+ time.timeZone = "Europe/Berlin";
+
+ networking = {
+ hostName = "vm";
+ useDHCP = lib.mkDefault true;
+ };
+
+ boot = {
+ loader = {
+ grub = {
+ enable = true;
+ # device = "/dev/sda"; # [managed by install.sh]
+ gfxmodeEfi = "1920x1080";
+ };
+ };
+
+ tmp.useTmpfs = true;
+ kernelPackages = pkgs.linuxPackages_xanmod_latest;
+ supportedFilesystems = [ "btfs" "vfat" "xfs" ];
+ initrd = {
+ availableKernelModules = [ "nvme" "xhci_pci" "ahci"
+ "usbhid" "usb_storage" "sd_mod" ];
+ };
+ };
+
+ services = {
+ fstrim.enable = true;
+ btrfs.autoScrub.enable = true;
+ };
+
+ fileSystems = {
+ # These are system specific. If you have any additional drives that are not
+ # your root device you can add and mount them here. Added nofail so that you can
+ # install this configuration on a device without it exploding when you don't have
+ # these specific partitions.
+ };
+
+ system.stateVersion = "24.11"; # [managed by install.sh]
+}
+
diff --git a/hosts/vm/disko.nix b/hosts/vm/disko.nix
new file mode 100644
index 0000000..887d609
--- /dev/null
+++ b/hosts/vm/disko.nix
@@ -0,0 +1,54 @@
+{ ... }:
+
+{
+ disko.devices = {
+ disk = {
+ master = {
+ type = "disk";
+ device = "/dev/vda"; # [managed by install.sh]
+ content = {
+ type = "gpt";
+ partitions = {
+ grub_mbr = {
+ size = "1M";
+ type = "EF02"; # for grub MBR
+ };
+ boot = {
+ size = "1G";
+ content = {
+ type = "filesystem";
+ format = "ext4";
+ mountpoint = "/boot";
+ };
+ };
+ root = {
+ size = "100%";
+ content = {
+ type = "btrfs";
+ extraArgs = [ "-f" "-L nixos" ];
+ subvolumes = {
+ /* Do not rename the root partition as it'll break impermanence */
+ "/root" = {
+ mountpoint = "/";
+ mountOptions = [
+ "noatime"
+ "compress=zstd"
+ ];
+ };
+
+ "/nix" = {
+ mountpoint = "/nix";
+ mountOptions = [
+ "noatime"
+ "compress=zstd"
+ ];
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+}
diff --git a/hosts/vm/packages.nix b/hosts/vm/packages.nix
new file mode 100644
index 0000000..c83d3ca
--- /dev/null
+++ b/hosts/vm/packages.nix
@@ -0,0 +1,14 @@
+{ ... }:
+
+{
+ imports = let
+ modules = ../../modules/nixos;
+ in [
+ "${modules}/core"
+ "${modules}/hardware/audio"
+ "${modules}/hardware/gpu/graphics.nix"
+ "${modules}/multimedia"
+ "${modules}/desktop/gnome"
+ ];
+}
+
diff --git a/hosts/workstation/default.nix b/hosts/workstation/default.nix
deleted file mode 100644
index 6196d91..0000000
--- a/hosts/workstation/default.nix
+++ /dev/null
@@ -1,96 +0,0 @@
-{ config, pkgs, ... }:
-
-{
- imports = [
- ./hardware-configuration.nix
- ./persist.nix
- ../../home/default.nix
-
- ../../modules/desktop/environments/kde.nix
- ../../modules/system/basic.nix
- ../../modules/system/security.nix
- ../../modules/desktop/apps/communication.nix
- ../../modules/desktop/apps/games.nix
- ../../modules/desktop/apps/multimedia.nix
- ../../modules/system/virtualisation.nix
- ../../modules/system/development.nix
- ../../modules/packages/firefox.nix
- ../../modules/packages/zsh.nix
- ../../modules/packages/fastfetch.nix
- ../../modules/packages/tmux.nix
- ];
-
- boot.loader.efi.canTouchEfiVariables = true;
- boot.loader.grub = {
- enable = true;
- efiSupport = true;
- device = "nodev";
- gfxmodeEfi = "1920x1080";
- };
- boot.kernelPackages = pkgs.linuxPackages_xanmod_latest;
- boot.supportedFilesystems = [ "btrfs" "xfs" ];
-
- networking = {
- hostName = "workstation";
- enableIPv6 = false;
- };
-
- time.timeZone = "Europe/Berlin";
-
- i18n.defaultLocale = "en_US.UTF-8";
- console = {
- font = "Lat2-Terminus16";
- keyMap = "uk";
- # useXkbConfig = true;
- };
-
- nixpkgs.config.allowUnfree = true;
- services.xserver.videoDrivers = [ "nvidia" ];
- hardware = {
- graphics = {
- enable = true;
- enable32Bit = true;
- };
- nvidia = {
- modesetting.enable = true;
- open = true;
- package = config.boot.kernelPackages.nvidiaPackages.beta;
- };
- };
-
- programs.mtr.enable = true;
- programs.gnupg.agent = {
- enable = true;
- enableSSHSupport = true;
- };
-
- security.rtkit.enable = true;
- services.pipewire = {
- enable = true;
- alsa = {
- enable = true;
- support32Bit = true;
- };
- pulse.enable = true;
- jack.enable = true;
- };
-
- nix = {
- settings = {
- substituters = [
- "https://cuda-maintainers.cachix.org"
- ];
- trusted-public-keys = [
- "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
- ];
- };
- extraOptions = ''
- experimental-features = nix-command flakes
- '';
- };
-
- # nixpkgs.config.cudaSupport = true;
-
- system.stateVersion = "23.11";
-}
-
diff --git a/hosts/workstation/hardware-configuration.nix b/hosts/workstation/hardware-configuration.nix
deleted file mode 100644
index b2d0307..0000000
--- a/hosts/workstation/hardware-configuration.nix
+++ /dev/null
@@ -1,78 +0,0 @@
-{ config, lib, modulesPath, ... }:
-
-{
- imports = [
- (modulesPath + "/installer/scan/not-detected.nix")
- ];
-
- fileSystems."/" = {
- device = "/dev/disk/by-uuid/5cc0482e-ac92-41c7-b2fc-2d9b4a19eeec";
- fsType = "btrfs";
- options = [ "subvol=root" "compress=zstd" "noatime" ];
- };
-
- fileSystems."/nix" = {
- device = "/dev/disk/by-uuid/5cc0482e-ac92-41c7-b2fc-2d9b4a19eeec";
- fsType = "btrfs";
- options = [ "subvol=nix" "compress=zstd" "noatime" ];
- neededForBoot = true;
- };
-
- fileSystems."/boot" = {
- device = "/dev/disk/by-uuid/3012-B13E";
- fsType = "vfat";
- };
-
- fileSystems."/home/hu/mounts/vault" = {
- device = "/dev/disk/by-uuid/048d175b-0e3e-4ec7-955b-3d9a45f9f237";
- fsType = "xfs";
- };
-
- fileSystems."/home/hu/mounts/attic" = {
- device = "/dev/disk/by-uuid/ec32ce36-9f53-4f44-ac8f-2c9163f0b3d7";
- fsType = "xfs";
- };
-
- boot.initrd.availableKernelModules = [
- "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"
- ];
- boot.initrd.kernelModules = [ ];
- boot.kernelModules = [ "kvm-amd" ];
- boot.extraModulePackages = [ ];
- boot.extraModprobeConfig = "options kvm_amd nested=1";
- boot.kernelParams = [
- "nvidia_drm.fbdev=1"
- "nvidia.NVreg_PreserveVideoMemoryAllocations=1"
- ];
-
- boot.initrd.postDeviceCommands = lib.mkAfter ''
- mkdir /btrfs_tmp
- mount ${config.fileSystems."/".device} /btrfs_tmp
- if [[ -e /btrfs_tmp/root ]]; then
- mkdir -p /btrfs_tmp/old_roots
- timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
- mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
- fi
-
- delete_subvolume_recursively() {
- IFS=$'\n'
- for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
- delete_subvolume_recursively "/btrfs_tmp/$i"
- done
- btrfs subvolume delete "$1"
- }
-
- for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do
- delete_subvolume_recursively "$i"
- done
-
- btrfs subvolume create /btrfs_tmp/root
- umount /btrfs_tmp
- '';
-
- networking.useDHCP = lib.mkDefault true;
-
- nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
- hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
-}
-
diff --git a/hosts/workstation/persist.nix b/hosts/workstation/persist.nix
deleted file mode 100644
index 5af2054..0000000
--- a/hosts/workstation/persist.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-{ ... }:
-
-{
- environment.persistence."/nix/persist" = {
- hideMounts = true;
- directories = [
- "/var/log"
- "/var/lib/nixos"
- "/var/lib/systemd/coredump"
- {
- directory = "/var/lib/colord";
- user = "colord";
- group = "colord";
- mode = "u=rwx,g=rx,o=";
- }
- "/etc/NetworkManager/system-connections"
- ];
- files = [
- "/etc/machine-id"
- ];
- };
-}
-
diff --git a/hosts/x220/default.nix b/hosts/x220/default.nix
deleted file mode 100644
index 5030445..0000000
--- a/hosts/x220/default.nix
+++ /dev/null
@@ -1,78 +0,0 @@
-{ pkgs, ... }:
-
-{
- imports = [
- ./hardware-configuration.nix
- ./persist.nix
- ../../home/default.nix
-
- ../../modules/desktop/environments/river.nix
- ../../modules/system/basic.nix
- ../../modules/system/security.nix
- ../../modules/desktop/apps/communication.nix
- ../../modules/desktop/apps/multimedia.nix
- ../../modules/system/development.nix
- ../../modules/packages/firefox.nix
- ../../modules/packages/zsh.nix
- ../../modules/packages/fastfetch.nix
- ../../modules/packages/tmux.nix
- ];
-
- hardware.bluetooth.enable = true;
-
- boot = {
- loader.grub = {
- enable = true;
- device = "/dev/sda";
- gfxmodeEfi = "1366x768";
- };
- kernelPackages = pkgs.linuxPackages_xanmod_latest;
- supportedFilesystems = [ "btrfs" ];
- };
-
- networking = {
- hostName = "x220";
- networkmanager.enable = true;
- };
-
- users.users.hu.extraGroups = [ "networkmanager" ];
-
- time.timeZone = "Europe/Berlin";
-
- i18n.defaultLocale = "en_US.UTF-8";
- console = {
- font = "Lat2-Terminus16";
- keyMap = "de";
- # useXkbConfig = true;
- };
-
- nixpkgs.config.allowUnfree = true;
-
- programs.mtr.enable = true;
- programs.gnupg.agent = {
- enable = true;
- enableSSHSupport = true;
- };
-
- security.rtkit.enable = true;
- services.pipewire = {
- enable = true;
- alsa = {
- enable = true;
- support32Bit = true;
- };
- pulse.enable = true;
- jack.enable = true;
- };
-
- services.tlp.enable = true;
-
- nix = {
- extraOptions = ''
- experimental-features = nix-command flakes
- '';
- };
-
- system.stateVersion = "24.05";
-}
-
diff --git a/hosts/x220/hardware-configuration.nix b/hosts/x220/hardware-configuration.nix
deleted file mode 100644
index 789fd90..0000000
--- a/hosts/x220/hardware-configuration.nix
+++ /dev/null
@@ -1,61 +0,0 @@
-{ config, lib, modulesPath, ... }:
-
-{
- imports = [
- (modulesPath + "/installer/scan/not-detected.nix")
- ];
-
- fileSystems."/" = {
- device = "/dev/disk/by-uuid/e0b531cf-b575-4579-b866-9b7265e01b0a";
- fsType = "btrfs";
- options = [ "subvol=root" "compress=zstd" "noatime" "ssd" ];
- };
-
- fileSystems."/nix" = {
- device = "/dev/disk/by-uuid/e0b531cf-b575-4579-b866-9b7265e01b0a";
- fsType = "btrfs";
- options = [ "subvol=nix" "compress=zstd" "noatime" "ssd" ];
- neededForBoot = true;
- };
-
- fileSystems."/boot" = {
- device = "/dev/disk/by-uuid/bfe6e556-44e9-427f-9ae6-eddae6c62298";
- fsType = "ext4";
- };
-
- boot.initrd.luks.devices."vg".device = "/dev/disk/by-uuid/92b4f484-2c00-47e7-baf6-9f396883e231";
- boot.initrd.availableKernelModules = [
- "ehci_pci" "ahci" "xhci_pci" "usb_storage" "sd_mod" "sdhci_pci"
- ];
- boot.kernelModules = [ "kvm-intel" ];
- boot.initrd.postDeviceCommands = lib.mkAfter ''
- mkdir /btrfs_tmp
- mount ${config.fileSystems."/".device} /btrfs_tmp
- if [[ -e /btrfs_tmp/root ]]; then
- mkdir -p /btrfs_tmp/old_roots
- timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
- mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
- fi
-
- delete_subvolume_recursively() {
- IFS=$'\n'
- for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
- delete_subvolume_recursively "/btrfs_tmp/$i"
- done
- btrfs subvolume delete "$1"
- }
-
- for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do
- delete_subvolume_recursively "$i"
- done
-
- btrfs subvolume create /btrfs_tmp/root
- umount /btrfs_tmp
- '';
-
- networking.useDHCP = lib.mkDefault true;
-
- nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
- hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
-}
-
diff --git a/hosts/x220/persist.nix b/hosts/x220/persist.nix
deleted file mode 100644
index 5af2054..0000000
--- a/hosts/x220/persist.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-{ ... }:
-
-{
- environment.persistence."/nix/persist" = {
- hideMounts = true;
- directories = [
- "/var/log"
- "/var/lib/nixos"
- "/var/lib/systemd/coredump"
- {
- directory = "/var/lib/colord";
- user = "colord";
- group = "colord";
- mode = "u=rwx,g=rx,o=";
- }
- "/etc/NetworkManager/system-connections"
- ];
- files = [
- "/etc/machine-id"
- ];
- };
-}
-
diff --git a/install.sh b/install.sh
new file mode 100755
index 0000000..0fd57f8
--- /dev/null
+++ b/install.sh
@@ -0,0 +1,184 @@
+#!/usr/bin/env sh
+
+# Author: caem - https://caem.dev
+
+# install.sh - Installation script for my NixOS configuration
+#
+# This script aims to automate the deployment of my configuration
+# on a new machine.
+
+args_ensure_extra_arg() {
+ if [ -z "$2" ] || [ "$(echo "$2" | cut -c 1-1)" = "-" ]; then
+ >&2 echo "Argument '$1' requires an extra argument. Run --help for more info."
+ exit 1
+ fi
+}
+
+args_ensure_is_set() {
+ if [ -z "$2" ]; then
+ >&2 echo "Argument '$1' is required to be set. Please consult the README or run again with --help."
+ exit 1
+ fi
+}
+
+args() {
+ while [ -n "$1" ]; do
+ case "$1" in
+ "-h" | "--help")
+ echo ""
+ echo "$0 - Installation script for my NixOS configuration"
+ echo ""
+ echo "arguments:"
+ echo " -h|--help Print this and exit"
+ echo " -d|--device [device] (required) The device you want to install NixOS on to"
+ echo " -o|--host [hostname] (required) The host from ./hosts you want to install"
+ echo " -b|--build Build the system without installing"
+ echo ""
+ echo "origin: https://github.com/c4em/caenix"
+ echo ""
+ exit 0
+ ;;
+
+ "-d" | "--device")
+ args_ensure_extra_arg "$@"
+ if [ ! -b "$2" ]; then
+ >&2 echo "'$2' is not a valid block device. Make sure you selected the right drive"
+ exit 1
+ fi
+
+ CAENIX_INSTALL_DEVICE="$2"
+ shift 2
+ ;;
+
+ "-o" | "--host")
+ args_ensure_extra_arg "$@"
+
+ if [ ! -d "./hosts/$2" ]; then
+ >&2 echo "Invalid hostname '$2'. Make sure it exists in ./hosts"
+ exit 1
+ fi
+
+ CAENIX_HOSTNAME="$2"
+ shift 2
+ ;;
+ "-b" | "--build")
+ CAENIX_DO_ONLY_BUILD=1
+ shift 1
+ ;;
+ *)
+ >&2 echo "Unrecognized argument '$1'. Run with --help to view accepted arguments."
+ exit 1
+ ;;
+ esac
+ done
+
+ args_ensure_is_set "--host" "$CAENIX_HOSTNAME"
+ if [ -z "$CAENIX_DO_ONLY_BUILD" ]; then
+ args_ensure_is_set "--device" "$CAENIX_INSTALL_DEVICE"
+ fi
+}
+
+sed_safe () {
+ # I got this off of some random StackOverflow answer. Don't put too much trust in this.
+ printf "%s" "$1" | sed -r 's/([\$\.\*\/\[\\^])/\\\1/g' | sed 's/[]]/\[]]/g'
+}
+
+update_managed_values() {
+ sed -i 's/\( *device = \)".*"\(; # [managed by install\.sh].*\)/\1"'"$(sed_safe "$CAENIX_INSTALL_DEVICE")"'"\2/' "./hosts/$CAENIX_HOSTNAME/default.nix"
+ sed -i 's/\( *device = \)".*"\(; #.*\)/\1"'"$(sed_safe "$CAENIX_INSTALL_DEVICE")"'"\2/' "./hosts/$CAENIX_HOSTNAME/disko.nix"
+ sed -i 's/\( *system.stateVersion = \)".*"\(; #.*\)/\1"'"$(sed_safe "$(nixos-version | cut -f1,2 -d '.')")"'"\2/' "./hosts/$CAENIX_HOSTNAME/default.nix"
+}
+
+build() {
+ nix build ".#nixosConfigurations.${CAENIX_HOSTNAME}.config.system.build.toplevel"
+}
+
+permissions() {
+ if [ "$(id -u)" = "0" ]; then
+ sudo () {
+ true
+ }
+ else
+ sudo -v
+ fi
+}
+
+ensure_confirmation() {
+ printf "\e[1;31m=== ARE YOU SURE YOU WANT TO CONTINUE WITH THE INSTALLATION ===\e[0m\n\n"
+ printf "This will \e[1;31mIRREVERSIBLY\e[0m wipe all data in '%s'\n" "$CAENIX_INSTALL_DEVICE"
+ printf "This disk contains following partitions:\n\n"
+ lsblk -o NAME,SIZE,TYPE,FSTYPE "$CAENIX_INSTALL_DEVICE"
+ printf "\n"
+ lsblk -no NAME "$CAENIX_INSTALL_DEVICE" | tail -n +2 | tr -cd '[:alnum:][:space:]' | xargs -I {} -- df -h "/dev/{}"
+ printf "\n"
+
+ printf "Please write 'Yes, do as I say!' to continue with the installation\n> "
+ read -r install_prompt
+ if [ "$install_prompt" != "Yes, do as I say!" ]; then
+ echo "Cancelling installation"
+ exit 0
+ else
+ CAENIX_CONFIRM_DISK_NUKE="yes"
+ fi
+}
+
+partition_disk() {
+ if [ "$CAENIX_CONFIRM_DISK_NUKE" = "yes" ]; then
+ sudo nix --experimental-features 'flakes nix-command' run github:nix-community/disko/latest -- \
+ --mode destroy,format,mount --yes-wipe-all-disks "./hosts/$CAENIX_HOSTNAME/disko.nix"
+ else
+ >&2 echo "Aborted installation due to invalid state in the partitioning step."
+ exit 1
+ fi
+}
+
+install() {
+ yes | sudo nixos-install --no-root-passwd --flake ".#$CAENIX_HOSTNAME"
+}
+
+copy_files_to_new_install() {
+ username="$(grep user ./flake.nix | sed -e 's/.*user = "\(.*\)";.*/\1/')"
+ if [ -z "$username" ]; then
+ >&2 echo "Cannot determine username"
+ exit 1
+ fi
+
+ sudo cp -vr . /mnt/nix/config
+ sudo mkdir -p "/mnt/nix/persist/home/$username/programming/personal"
+ sudo ln -svf /nix/config "/mnt/nix/persist/home/$username/programming/personal/caenix"
+ sudo chown -R 1000:100 "/mnt/nix/persist/home/$username"
+ sudo chown -R 1000:100 "/mnt/nix/config"
+}
+
+reboot_on_consent() {
+ printf "\n\nInstallation finished. Would you like to reboot?\n[y/n] > "
+ read -r do_reboot
+ if [ "$do_reboot" = "y" ] || [ "$do_reboot" = "Y" ]; then
+ sudo reboot
+ fi
+}
+
+main () {
+ args "$@"
+ permissions
+
+ if [ -n "$CAENIX_DO_ONLY_BUILD" ]; then
+ if [ -n "$CAENIX_INSTALL_DEVICE" ]; then
+ update_managed_values
+ fi
+
+ build
+ exit 0
+ fi
+
+ ensure_confirmation
+ update_managed_values
+ partition_disk
+ copy_files_to_new_install
+ install
+ reboot_on_consent
+}
+
+set -e
+main "$@"
+
diff --git a/lib/default.nix b/lib/default.nix
index c62cc11..89a0986 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -1,7 +1,5 @@
{ lib }:
-# todo: Write a function to import all of these automatically
-
let
fs = import ./fs.nix { inherit lib; };
hosts = import ./hosts.nix { inherit lib; };
diff --git a/lib/fs.nix b/lib/fs.nix
index cb8d639..7e44d04 100644
--- a/lib/fs.nix
+++ b/lib/fs.nix
@@ -5,6 +5,12 @@
path: let
dirs = builtins.readDir path;
in
- builtins.filter (name: dirs.${name} == "directory") (builtins.attrNames dirs);
+ builtins.filter (type: dirs.${type} == "directory") (builtins.attrNames dirs);
+
+ getModuleImports =
+ path: let
+ files = builtins.attrNames (builtins.removeAttrs (builtins.readDir path) ["default.nix"]);
+ in
+ map (file: "${path}/${file}") files;
}
diff --git a/lib/hosts.nix b/lib/hosts.nix
index f94a590..02cee0a 100644
--- a/lib/hosts.nix
+++ b/lib/hosts.nix
@@ -2,15 +2,23 @@
{
mkHosts = {
- modules,
nixpkgs,
inputs,
+ modules,
+ user,
}: builtins.listToAttrs (builtins.map (host: {
name = host;
value = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
- modules = modules ++ [ ../hosts/${host} ];
- specialArgs = { inherit inputs; };
+ modules = modules ++ [
+ ../hosts/${host}
+ ../modules/nixos/user/${user}.nix
+ ];
+ specialArgs = {
+ inherit inputs lib;
+ username = user;
+ cfgPath = ../.;
+ };
};
}) (lib.getDirsInDir ../hosts));
}
diff --git a/modules/desktop/apps/communication.nix b/modules/desktop/apps/communication.nix
deleted file mode 100644
index fe72f8a..0000000
--- a/modules/desktop/apps/communication.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{ pkgs, ... }:
-
-{
- environment.persistence."/nix/persist".users.hu.directories = [
- ".config/Signal"
- ".config/vesktop"
- ".config/tutanota-desktop"
- ".config/tuta_integration"
- ".config/Element"
- ];
-
- environment.systemPackages = with pkgs; [
- tutanota-desktop
- signal-desktop
- element-desktop
- vesktop
- ];
-}
-
diff --git a/modules/desktop/apps/games.nix b/modules/desktop/apps/games.nix
deleted file mode 100644
index f380665..0000000
--- a/modules/desktop/apps/games.nix
+++ /dev/null
@@ -1,35 +0,0 @@
-{ pkgs, inputs, ... }:
-
-{
- environment.persistence."/nix/persist".users.hu.directories = [
- ".steam"
- ".local/share/Steam"
- ".local/share/honkers-railway-launcher"
- ".local/share/anime-game-launcher"
- ".local/share/PrismLauncher"
- ".xlcore"
- ".local/share/Euro Truck Simulator 2"
- ".local/share/osu"
- ".local/share/Colossal Order"
- ];
-
- programs.steam = {
- enable = true;
- remotePlay.openFirewall = false;
- dedicatedServer.openFirewall = true;
- gamescopeSession.enable = true;
- };
-
- environment.systemPackages = with pkgs; [
- prismlauncher
- protonup-qt
- osu-lazer-bin
- protontricks
- ];
-
- imports = [ inputs.aagl.nixosModules.default ];
- nix.settings = inputs.aagl.nixConfig;
-
- programs.anime-game-launcher.enable = true;
-}
-
diff --git a/modules/desktop/apps/multimedia.nix b/modules/desktop/apps/multimedia.nix
deleted file mode 100644
index c11ca5e..0000000
--- a/modules/desktop/apps/multimedia.nix
+++ /dev/null
@@ -1,41 +0,0 @@
-{ pkgs, ... }:
-
-{
- environment.persistence."/nix/persist".users.hu.directories = [
- ".config/OpenTabletDriver"
- ".config/tidal-hifi"
- ];
-
- environment.systemPackages = with pkgs; [
- mpv
- imagemagick
- ffmpeg-full
- yt-dlp
- (pkgs.symlinkJoin {
- name = "flowblade";
- paths = [ pkgs.flowblade ];
- buildInputs = [ pkgs.makeWrapper ];
- postBuild = ''
- rm "$out/bin/flowblade"
- echo "#!/bin/sh" > "$out/bin/flowblade"
- echo "SDL12COMPAT_NO_QUIT_VIDEO=1 \
- GDK_BACKEND=x11 \
- SDL_VIDEODRIVER=x11 \
- ${pkgs.flowblade}/bin/flowblade" >> "$out/bin/flowblade"
- chmod 555 "$out/bin/flowblade"
- '';
- })
- gimp
- inkscape
- krita
- tidal-hifi
- blender
- obs-studio
- ];
-
- # hardware.opentabletdriver = {
- # enable = true;
- # daemon.enable = true;
- # };
-}
-
diff --git a/modules/desktop/environments/hyprland.nix b/modules/desktop/environments/hyprland.nix
deleted file mode 100644
index 459958c..0000000
--- a/modules/desktop/environments/hyprland.nix
+++ /dev/null
@@ -1,218 +0,0 @@
-{ pkgs, ...}:
-
-{
- imports = [
- ../../system/fonts.nix
- ../../packages/waybar.nix
- ../../packages/rofi.nix
- ../../packages/foot.nix
- ];
-
- environment.systemPackages = with pkgs; [
- hyprpaper
- rofi-wayland
- foot
- wl-clipboard
- nautilus
- pavucontrol
- nvidia-vaapi-driver
- ];
-
- environment.sessionVariables = {
- LIBVA_DRIVER_NAME = "nvidia";
- XDG_SESSION_TYPE = "wayland";
- GBM_BACKEND = "nvidia-drm";
- __GLX_VENDOR_LIBRARY_NAME = "nvidia";
- NVD_BACKEND = "direct";
- MOZ_DISABLE_RDD_SANDBOX = 1;
- NIXOS_OZONE_WL = 1;
- };
-
- programs.hyprland = {
- enable = true;
- };
-
- services.gnome.gnome-keyring.enable = true;
- security.pam.services.greetd.enableGnomeKeyring = true;
-
- systemd.services.greetd.serviceConfig = {
- Type = "idle";
- StandardInput = "tty";
- StandardOutput = "tty";
- StandardError = "journal";
- TTYReset = true;
- TTYHangup = true;
- TTYVTDisallocate = true;
- };
-
- services.greetd = {
- enable = true;
- settings = {
- default_session = {
- command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --asterisks --cmd hyprland";
- user = "greeter";
- };
- };
- };
-
- xdg.portal = {
- enable = true;
- extraPortals = with pkgs; [
- xdg-desktop-portal-gtk
- ];
- };
-
- home-manager.users.hu = {
- home.pointerCursor = {
- gtk.enable = true;
- name = "Bibata-Modern-Classic";
- package = pkgs.bibata-cursors;
- size = 24;
- };
-
- dconf.settings = {
- "org/gnome/desktop/interface" = {
- color-scheme = "prefer-dark";
- };
- };
-
- gtk = {
- enable = true;
- theme = {
- name = "adw-gtk3-dark";
- package = pkgs.adw-gtk3;
- };
-
- iconTheme = {
- name = "Adwaita";
- package = pkgs.adwaita-icon-theme;
- };
- };
-
- qt = {
- enable = true;
- platformTheme.name = "adwaita";
- style = {
- name = "adwaita-dark";
- package = pkgs.adwaita-qt;
- };
- };
-
- services.hyprpaper = {
- enable = true;
- settings = {
- ipc = "on";
- splash = false;
- preload = [
- "/nix/config/assets/wallpapers/hyprland.jpg"
- ];
- wallpaper = [
- ",/nix/config/wallpapers/hyprland.jpg"
- ];
- };
- };
-
- wayland.windowManager.hyprland = {
- enable = true;
- systemd = {
- enable = true;
- variables = [ "--all" ];
- };
-
- settings = {
- "$mod" = "SUPER";
- "$terminal" = "foot";
- "$menu" = "rofi -show drun";
-
- monitor = "DP-1,1920x1080@144,auto,1";
-
- cursor = {
- no_hardware_cursors = true;
- };
-
- render = {
- explicit_sync = 0;
- };
-
- input = {
- kb_layout = "gb:intl";
- follow_mouse = 1;
- };
-
- general = {
- gaps_in = 3;
- gaps_out = 6;
- border_size = 2;
- layout = "master";
- allow_tearing = true;
- "col.inactive_border" = "rgb(242424)";
- "col.active_border" = "rgb(3584E4)";
- };
-
- master = {
- mfact = 0.5;
- };
-
- decoration = {
- rounding = 5;
- blur = {
- enabled = true;
- size = 4;
- passes = 1;
- };
- };
-
- bindm = [
- "$mod, mouse:272, movewindow"
- "$mod, mouse:273, resizewindow"
- ];
-
- bind = [
- "$mod, P, exec, $menu"
- "$mod, RETURN, exec, $terminal"
- ", Scroll_Lock, exec, pavucontrol"
- "$mod, f, exec, nautilus"
-
- ", XF86AudioLowerVolume, exec, wpctl set-volume -l 1.4 @DEFAULT_AUDIO_SINK@ 5%-"
- ", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.4 @DEFAULT_AUDIO_SINK@ 5%+"
- ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
- ", Pause, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
-
- "$mod SHIFT, C, killactive"
- "$mod, SPACE, togglefloating"
- "$mod SHIFT, M, exit,"
-
- "$mod SHIFT, RETURN, layoutmsg, swapwithmaster"
- "$mod SHIFT, h, layoutmsg, mfact -0.05"
- "$mod SHIFT, l, layoutmsg, mfact +0.05"
-
- "$mod, h, movefocus, l"
- "$mod, j, movefocus, d"
- "$mod, k, movefocus, u"
- "$mod, l, movefocus, r"
-
- "$mod, 1, workspace, 1"
- "$mod, 2, workspace, 2"
- "$mod, 3, workspace, 3"
- "$mod, 4, workspace, 4"
- "$mod, 5, workspace, 5"
- "$mod, 6, workspace, 6"
- "$mod, 7, workspace, 7"
- "$mod, 8, workspace, 8"
- "$mod, 9, workspace, 9"
-
- "$mod SHIFT, 1, movetoworkspace, 1"
- "$mod SHIFT, 2, movetoworkspace, 2"
- "$mod SHIFT, 3, movetoworkspace, 3"
- "$mod SHIFT, 4, movetoworkspace, 4"
- "$mod SHIFT, 5, movetoworkspace, 5"
- "$mod SHIFT, 6, movetoworkspace, 6"
- "$mod SHIFT, 7, movetoworkspace, 7"
- "$mod SHIFT, 8, movetoworkspace, 8"
- "$mod SHIFT, 9, movetoworkspace, 9"
- ];
- };
- };
- };
-}
-
diff --git a/modules/desktop/environments/kde.nix b/modules/desktop/environments/kde.nix
deleted file mode 100644
index ea7bd62..0000000
--- a/modules/desktop/environments/kde.nix
+++ /dev/null
@@ -1,209 +0,0 @@
-{ pkgs, ... }:
-
-let
- sddm-background-drv = pkgs.stdenvNoCC.mkDerivation {
- name = "sddm-background-drv";
- src = ../../../assets/wallpapers;
- dontUnpack = true;
- installPhase = ''
- cp $src/kde.png $out
- '';
- };
-in {
- imports = [
- ../../system/fonts.nix
- ];
-
- environment.persistence."/nix/persist".directories = [
- "/var/lib/AccountsService/"
- ];
-
- environment.persistence."/nix/persist".users.hu.directories = [
- ".local/share/kwalletd"
- ".local/share/baloo"
- ".local/share/dolphin"
- ];
-
- environment.persistence."/nix/persist".users.hu.files = [
- ".config/kwinoutputconfig.json" # https://github.com/nix-community/plasma-manager/issues/172
- ".local/state/konsolestaterc"
- ];
-
- networking.networkmanager.enable = true;
- users.users.hu.extraGroups = [ "networkmanager" ];
-
- environment.sessionVariables = {
- LIBVA_DRIVER_NAME = "nvidia";
- XDG_SESSION_TYPE = "wayland";
- GBM_BACKEND = "nvidia-drm";
- __GLX_VENDOR_LIBRARY_NAME = "nvidia";
- NVD_BACKEND = "direct";
- NIXOS_OZONE_WL = 1;
- };
-
- services.desktopManager.plasma6.enable = true;
- services.displayManager.sddm = {
- enable = true;
- wayland.enable = true;
- };
-
- environment.plasma6.excludePackages = with pkgs.kdePackages; [
- plasma-browser-integration
- khelpcenter
- krdp
- ];
-
- environment.systemPackages = with pkgs; [
- nvidia-vaapi-driver
- kdePackages.sddm-kcm
- (pkgs.writeTextDir "share/sddm/themes/breeze/theme.conf.user" ''
- [General]
- background=${sddm-background-drv}
- '')
- networkmanager-openvpn
- wl-clipboard
- ];
-
- home-manager.users.hu = {
- dconf.settings = {
- "org/gnome/desktop/interface" = {
- color-scheme = "prefer-dark";
- };
- };
-
- gtk = {
- gtk2.configLocation = "/home/hu/.config/gtk-2.0/gtkrc";
- enable = true;
- theme = {
- name = "Breeze";
- package = pkgs.kdePackages.breeze-gtk;
- };
- };
-
- programs.konsole = {
- enable = true;
- defaultProfile = "custom";
- customColorSchemes = {
- "custom" = ../../packages/konsole/custom.colorscheme;
- };
- profiles = {
- custom = {
- name = "custom";
- colorScheme = "custom";
- font = {
- name = "Go Mono Nerd Font";
- size = 12;
- };
- };
- };
- };
-
- programs.plasma = {
- enable = true;
- workspace = {
- lookAndFeel = "org.kde.breezedark.desktop";
- wallpaper = "/nix/config/assets/wallpapers/kde.png";
- };
-
- panels = [
- {
- location = "left";
- floating = true;
- widgets = [
- {
- kickoff = {
- icon = "nix-snowflake-white";
- };
- }
- {
- iconTasks = {
- launchers = [
- "applications:org.kde.dolphin.desktop"
- "applications:org.kde.konsole.desktop"
- "applications:firefox-esr.desktop"
- ];
- };
- }
- "org.kde.plasma.marginsseparator"
- {
- systemTray = {
- icons = {
- spacing = "small";
- };
- };
- }
- {
- digitalClock = {
- calendar.firstDayOfWeek = "monday";
- time.format = "24h";
- date.enable = false;
- };
- }
- "org.kde.plasma.pager"
- ];
- }
- ];
-
- powerdevil = {
- AC = {
- autoSuspend.action = "nothing";
- dimDisplay.enable = false;
- powerButtonAction = "hibernate";
- };
- };
-
- shortcuts = {
- kwin = {
- "Switch to Desktop 1" = "Meta+1";
- "Switch to Desktop 2" = "Meta+2";
- "Switch to Desktop 3" = "Meta+3";
- "Switch to Desktop 4" = "Meta+4";
- "Switch to Desktop 5" = "Meta+5";
- "Switch to Desktop 6" = "Meta+6";
- "Switch to Desktop 7" = "Meta+7";
- "Switch to Desktop 8" = "Meta+8";
- "Switch to Desktop 9" = "Meta+9";
-
- # Don't blame me for this. This is all the doing of kwin.
- # You're going to have to adjust this to your layout.
- "Window to Desktop 1" = "Meta+!";
- "Window to Desktop 2" = "Meta+\"";
- "Window to Desktop 3" = "Meta+£";
- "Window to Desktop 4" = "Meta+$";
- "Window to Desktop 5" = "Meta+%";
- "Window to Desktop 6" = "Meta+^";
- "Window to Desktop 7" = "Meta+&";
- "Window to Desktop 8" = "Meta+*";
- "Window to Desktop 9" = "Meta+(";
- };
- };
-
- configFile = {
- kwinrc = {
- Desktops = {
- Number = {
- value = 9;
- };
- Rows = {
- value = 3;
- };
- };
- };
-
- plasmaashellrc = {
- PlasmaViews = {
- panelOpacity = 2;
- };
- };
-
- kxkbrc = {
- Layout = {
- LayoutList = "gb";
- Use = true;
- };
- };
- };
- };
- };
-}
-
diff --git a/modules/desktop/environments/river.nix b/modules/desktop/environments/river.nix
deleted file mode 100644
index 2b2cd8c..0000000
--- a/modules/desktop/environments/river.nix
+++ /dev/null
@@ -1,305 +0,0 @@
-{ pkgs, ...}:
-
-{
- imports = [
- ../../system/fonts.nix
- ../../packages/foot.nix
- ];
-
- nixpkgs.overlays = [
- (final: prev: {
- sandbar = prev.sandbar.overrideAttrs (old: {
- src = prev.fetchFromGitHub {
- owner = "kolunmi";
- repo = "sandbar";
- rev = "e64a8b788d086cdf4ec44b51e62bdc7b6b5f8165";
- hash = "sha256-dNYYlm5CEdnvLjskrPJgquptIQpYgU+gxOu+bt+7sbw=";
- };
- });
- })
- ];
-
- environment.systemPackages = with pkgs; [
- foot # to be replaced with ghostty
- wl-clipboard
- sandbar
- pamixer
- pavucontrol
- tofi
- swaybg
- fnott
- slurp
- wf-recorder
- grim
- libnotify
- seahorse
- ];
-
- environment.sessionVariables = {
- NIXOS_OZONE_WL = 1;
- };
-
- programs.river.enable = true;
-
- services.gnome.gnome-keyring.enable = true;
- security.pam.services.greetd.enableGnomeKeyring = true;
-
- systemd.services.greetd.serviceConfig = {
- Type = "idle";
- StandardInput = "tty";
- StandardOutput = "tty";
- StandardError = "journal";
- TTYReset = true;
- TTYHangup = true;
- TTYVTDisallocate = true;
- };
-
- services.greetd = {
- enable = true;
- settings = {
- default_session = {
- command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --asterisks --cmd river";
- user = "greeter";
- };
- };
- };
-
- xdg.portal = {
- enable = true;
- extraPortals = with pkgs; [
- xdg-desktop-portal-gtk
- ];
- };
-
- home-manager.users.hu = {
- home.file."/home/hu/.config/tofi/config" = {
- text = ''
- width = 100%
- height = 100%
- border-width = 0
- outline-width = 0
- padding-left = 35%
- padding-top = 35%
- result-spacing = 25
- num-results = 5
- font = Go Mono Nerd Font
- background-color = #000A
- '';
- };
-
- home.file."/home/hu/.config/river/bar" = {
- text = ''
- #!/usr/bin/env sh
-
- FIFO="$XDG_RUNTIME_DIR/sandbar"
- [ -e "$FIFO" ] && rm -f "$FIFO"
- mkfifo "$FIFO"
-
- while cat "$FIFO"; do :; done | sandbar \
- -hide-normal-mode \
- -no-layout \
- -font "Go Mono Nerd Font:12" \
- -active-fg-color "#bbbbbb" \
- -active-bg-color "#222222" \
- -inactive-fg-color "#888888" \
- -inactive-bg-color "#111111" \
- -urgent-fg-color "#ab5656" \
- -title-fg-color "#bbbbbb" \
- -title-bg-color "#222222"
- '';
- executable = true;
- };
-
- home.file."/home/hu/.config/river/status" = {
- text = ''
- #!/usr/bin/env sh
-
- FIFO="$XDG_RUNTIME_DIR/sandbar"
- [ -e "$FIFO" ] || mkfifo "$FIFO"
-
- bat () {
- read -r bat_status < /sys/class/power_supply/BAT0/status
- read -r bat_capacity < /sys/class/power_supply/BAT0/capacity
- case "$bat_status" in
- "Charging")
- bat_status=""
- ;;
- "Discharging")
- bat_status=""
- ;;
- "Full")
- bat_status=""
- ;;
- "Not charging")
- bat_status=""
- ;;
- "Empty")
- bat_status=""
- ;;
-
- esac
- bat="[$bat_status $bat_capacity]"
- }
-
- datetime () {
- dat="[$(date "+%H:%M")]"
- }
-
- while true; do
- if [ -d /sys/class/power_supply/BAT0/ ]; then
- bat
- fi
- datetime
-
- echo "all status $bat$dat" > "$FIFO"
- sleep 20
- done
- '';
- executable = true;
- };
-
- wayland.windowManager.river = {
- enable = true;
- systemd.enable = true;
- settings = {
- map.normal = {
- "Super+Shift Return" = "spawn foot";
- "Super+Shift C" = "close";
- "Super J" = "focus-view next";
- "Super K"= "focus-view previous";
- "Super+Shift J" = "swap next";
- "Super+Shift K" = "swap previous";
- "Super Space" = "toggle-float";
- "Super+Shift R" = "spawn ~/.config/river/init";
- "Super+Shift Q" = "exit";
- "Super H" = "send-layout-cmd rivertile 'main-ratio -0.05'";
- "Super L" = "send-layout-cmd rivertile 'main-ratio +0.05'";
- "Super P" = "spawn '$(tofi-drun)'";
- "Super S" = "spawn ~/.config/river/screenshot.sh";
- "Super O" = "spawn ~/.config/river/screencast.sh";
- "Super+Shift O" = "spawn ~/.config/river/screencast.sh audio";
-
- "None XF86AudioRaiseVolume" = "spawn 'pamixer -i 5'";
- "None XF86AudioLowerVolume" = "spawn 'pamixer -d 5'";
- "None XF86AudioMute" = "spawn 'pamixer --toggle-mute'";
- "None XF86AudioMicMute" = "spawn 'pamixer --default-source --toggle-mute'";
- };
-
- map-pointer.normal = {
- "Super BTN_LEFT" = "move-view";
- "Super BTN_RIGHT" = "resize-view";
- };
-
- keyboard-layout = "de";
- default-layout = "rivertile";
- rule-add."-app-id" = {
- "'bar'" = "csd";
- };
- set-repeat = "50 300";
- spawn = [
- "'swaybg -i /nix/config/assets/wallpapers/river.png'"
- "/home/hu/.config/river/status"
- "/home/hu/.config/river/bar"
- "'fnott --config /home/hu/.config/fnott/fnott.conf.ini'"
- "'gnome-keyring-daemon --start'"
- ];
- border-width = 1;
- border-color-focused = "0x333333";
- border-color-unfocused = "0x000000";
- };
-
- extraConfig = "
- for i in $(seq 1 9); do
- tags=$((1 << ($i - 1)))
- riverctl map normal Super $i set-focused-tags $tags
- riverctl map normal Super+Shift $i set-view-tags $tags
- done
- rivertile -main-ratio 0.5 -view-padding 0 -outer-padding 0
- ";
- };
-
- dconf.settings = {
- "org/gnome/desktop/interface" = {
- color-scheme = "prefer-dark";
- };
- };
-
- gtk = {
- enable = true;
- theme = {
- name = "adw-gtk3-dark";
- package = pkgs.adw-gtk3;
- };
-
- iconTheme = {
- name = "Adwaita";
- package = pkgs.adwaita-icon-theme;
- };
- };
-
- home.file."/home/hu/.config/river/screenshot.sh" = {
- executable = true;
- text = ''
- #!/usr/bin/env sh
-
- mkdir -p "$HOME/images/screenshots"
- screenshot_file="$HOME/images/screenshots/$(date +%s).png"
- area="$(slurp)"
- if [ "$area" = "selection cancelled" ]; then
- exit 0
- fi
- grim -g "$area" "$screenshot_file"
- notify-send "Screenshot saved" "$screenshot_file"
- wl-copy < "$screenshot_file"
- '';
- };
-
- home.file."/home/hu/.config/river/screencast.sh" = {
- executable = true;
- text = ''
- #!/usr/bin/env sh
-
- if [ -n "$(pidof wf-recorder)" ]; then
- pkill --signal=SIGINT wf-recorder
- notify-send "Screencast saved" "$(cat "$HOME/.cache/last_screencast")"
- wl-copy < "$(cat "$HOME/.cache/last_screencast")"
- exit 0
- fi
-
- mkdir -p "$HOME/videos/screencasts/"
- screencast_file="$HOME/videos/screencasts/$(date +%s).mp4"
- area="$(slurp)"
- if [ "$area" = "selection cancelled" ]; then
- exit 0
- fi
-
- echo "$screencast_file" > "$HOME/.cache/last_screencast"
- if [ "$1" = "audio" ]; then
- wf-recorder -g "$area" --file="$screencast_file" --audio
- else
- wf-recorder -g "$area" --file="$screencast_file"
- fi
- '';
- };
-
- services.fnott = {
- enable = true;
- configFile = "/home/hu/.config/fnott/fnott.conf.ini";
- };
-
- home.file."/home/hu/.config/fnott/fnott.conf.ini" = {
- text = ''
- title-font=Go Mono Nerd Font
- body-font=Go Mono Nerd Font
-
- background=111111ff
- title-color=888888ff
- body-color=888888ff
- summary-color=888888ff
-
- default-timeout=10
- '';
- };
- };
-}
-
diff --git a/modules/home/caem/core/default.nix b/modules/home/caem/core/default.nix
new file mode 100644
index 0000000..99b31f4
--- /dev/null
+++ b/modules/home/caem/core/default.nix
@@ -0,0 +1,6 @@
+{ lib, ... }:
+
+{
+ imports = lib.getModuleImports ./.;
+}
+
diff --git a/modules/home/caem/core/security.nix b/modules/home/caem/core/security.nix
new file mode 100644
index 0000000..1e9c42b
--- /dev/null
+++ b/modules/home/caem/core/security.nix
@@ -0,0 +1,8 @@
+{ config, ... }:
+
+{
+ programs.gpg = {
+ enable = true;
+ homedir = "${config.xdg.dataHome}/gnupg";
+ };
+}
diff --git a/modules/home/caem/core/zsh/conf.d/ps1.zsh b/modules/home/caem/core/zsh/conf.d/ps1.zsh
new file mode 100644
index 0000000..baa60ee
--- /dev/null
+++ b/modules/home/caem/core/zsh/conf.d/ps1.zsh
@@ -0,0 +1,25 @@
+#!/usr/bin/env zsh
+
+local c0=$'%{\e[0m%}'
+local c31=$'%{\e[31m%}'
+local c33=$'%{\e[33m%}'
+local c34=$'%{\e[34m%}'
+local c35=$'%{\e[35m%}'
+local c38=$'%{\e[38m%}'
+
+local nix_shell_ps1_t=" $c34{$c33 shell$c34}$c0"
+local path_no_ghostty="$(echo "$PATH" | sed -e 's/:\/nix\/store\/.*-ghostty-.*\/bin://g')"
+if [ -n "$IN_NIX_SHELL" ]; then
+ local nix_shell_ps1="$nix_shell_ps1_t"
+elif [[ "$path_no_ghostty" == *"/nix/store"* ]]; then
+ IN_NIX_SHELL=true
+ local nix_shell_ps1="$nix_shell_ps1_t"
+fi
+
+setopt prompt_subst
+autoload -Uz vcs_info
+zstyle ':vcs_info:*' enable git
+zstyle ':vcs_info:*' formats " ${c34}${c0}${c31}(%b)${c0}"
+precmd () { vcs_info }
+
+export PS1='${c38}[${c35}%3~${c0}${vcs_info_msg_0_}${nix_shell_ps1}${c38}]${c0}# '
diff --git a/modules/home/caem/core/zsh/default.nix b/modules/home/caem/core/zsh/default.nix
new file mode 100644
index 0000000..ea4f6d4
--- /dev/null
+++ b/modules/home/caem/core/zsh/default.nix
@@ -0,0 +1,103 @@
+{ pkgs, config, ... }:
+
+{
+ home.packages = with pkgs; [
+ lsd
+ bat
+ fd
+ ripgrep
+ fzf
+ tmux
+ fastfetch
+ tre-command
+ btop
+ zsh-completions
+ nix-zsh-completions
+ git
+ ];
+
+ programs.bat = {
+ enable = true;
+ config = {
+ theme = "ansi";
+ };
+ };
+
+ programs.btop = {
+ enable = true;
+ settings = {
+ color_theme = "TTY";
+ };
+ };
+
+ programs.fastfetch = {
+ enable = true;
+ settings = {
+ modules = [
+ "title"
+ "separator"
+ "os"
+ "kernel"
+ "initsystem"
+ "uptime"
+ "datetime"
+ "packages"
+ "terminal"
+ "wm"
+ "shell"
+ "cpu"
+ "gpu"
+ "memory"
+ "break"
+ "colors"
+ ];
+ };
+ };
+
+ home.file.".zshenv".enable = false;
+ home.file.".config/zsh/conf.d" = {
+ source = ./conf.d;
+ recursive = true;
+ };
+ programs.zsh = {
+ enable = true;
+ enableCompletion = true;
+ autosuggestion.enable = true;
+ syntaxHighlighting.enable = true;
+ dotDir = ".config/zsh";
+ autocd = true;
+
+ history.size = 10000;
+ history.ignoreAllDups = true;
+ /* Not persisted on purpose */
+ history.path = "${config.xdg.cacheHome}/zsh_history";
+
+ shellAliases = {
+ cat = "bat --paging=never --wrap=never --style='changes,snip,numbers'";
+ ls = "lsd";
+ tree = "tre";
+ };
+
+ initExtra = ''
+ alias -g -- -h='-h 2>&1 | bat --language=help --style=plain'
+ alias -g -- --help='--help 2>&1 | bat --language=help --style=plain'
+
+ for dotfile in "$ZDOTDIR/conf.d/"*; do
+ source "$dotfile"
+ done
+ '';
+
+ plugins = [
+ {
+ name = "zsh-nix-shell";
+ file = "nix-shell.plugin.zsh";
+ src = pkgs.fetchFromGitHub {
+ owner = "chisui";
+ repo = "zsh-nix-shell";
+ rev = "v0.8.0";
+ sha256 = "1lzrn0n4fxfcgg65v0qhnj7wnybybqzs4adz7xsrkgmcsr0ii8b7";
+ };
+ }
+ ];
+ };
+}
diff --git a/modules/home/caem/default.nix b/modules/home/caem/default.nix
new file mode 100644
index 0000000..367ada9
--- /dev/null
+++ b/modules/home/caem/default.nix
@@ -0,0 +1,32 @@
+{ lib, config, ... }:
+
+{
+ imports = [
+ ./packages.nix
+ ];
+
+ home = {
+ username = "caem";
+ homeDirectory = "/home/caem";
+ stateVersion = "24.11";
+ };
+
+ home.file."${config.xdg.configHome}/user-dirs.dirs".force = lib.mkForce true;
+ xdg = {
+ enable = true;
+ userDirs = {
+ enable = true;
+
+ documents = "${config.home.homeDirectory}/documents";
+ download = "${config.home.homeDirectory}/download";
+ music = "${config.home.homeDirectory}/music";
+ pictures = "${config.home.homeDirectory}/images";
+ videos = "${config.home.homeDirectory}/videos";
+
+ /* I do not use these */
+ desktop = "${config.xdg.dataHome}/xdg/desktop";
+ publicShare = "${config.xdg.dataHome}/xdg/publicShare";
+ templates = "${config.xdg.dataHome}/xdg/templates";
+ };
+ };
+}
diff --git a/modules/home/caem/desktop/gnome/default.nix b/modules/home/caem/desktop/gnome/default.nix
new file mode 100644
index 0000000..09f7734
--- /dev/null
+++ b/modules/home/caem/desktop/gnome/default.nix
@@ -0,0 +1,103 @@
+{ pkgs, lib, inputs, config, ... }:
+
+let
+ picture-uri = if builtins.hasAttr "wallpaper" inputs.secrets.paths
+ then builtins.toString inputs.secrets.paths.wallpaper
+ else builtins.toString ../../../../../assets/wallpaper.jpg;
+in {
+ gtk = {
+ enable = true;
+ gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
+ gtk3.extraConfig = {
+ gtk-application-prefer-dark-theme = true;
+ };
+ };
+
+ dconf.settings = {
+ "org/gnome/desktop/background".picture-uri = picture-uri;
+ "org/gnome/desktop/background".picture-uri-dark = picture-uri;
+ "org/gnome/desktop/screensaver".picture-uri = picture-uri;
+ "org/gnome/desktop/interface" = {
+ accent-color = "slate";
+ color-scheme = "prefer-dark";
+ };
+ "org/gnome/desktop/input-sources" = {
+ sources = [
+ (lib.hm.gvariant.mkTuple ["xkb" "gb"])
+ (lib.hm.gvariant.mkTuple ["xkb" "de"])
+ ];
+ };
+ "org/gnome/desktop/peripherals/mouse" = {
+ accel-profile = "flat";
+ };
+ "org/gnome/shell" = {
+ disable-user-extensions = false;
+ allow-extension-installation = false;
+ enabled-extensions = with pkgs.gnomeExtensions; [
+ caffeine.extensionUuid
+ accent-directories.extensionUuid
+ just-perfection.extensionUuid
+ quick-settings-tweaker.extensionUuid
+ forge.extensionUuid
+ ];
+ favorite-apps = [
+ "firefox-esr.desktop"
+ "com.mitchellh.ghostty.desktop"
+ "org.gnome.Nautilus.desktop"
+ ];
+ };
+ "org/gnome/shell/extensions/forge" = {
+ float-always-on-top-enabled = false;
+ focus-border-toggle = false;
+ move-pointer-to-focus = true;
+ stacked-tiling-mode-enable = true;
+ };
+ "org/gnome/shell/extensions/just-perfection" = {
+ calendar = false;
+ events-button = false;
+ quick-settings-dark-mode = false;
+ world-clock = false;
+ };
+ "org/gnome/shell/extensions/quick-settings-tweaks" = {
+ notifications-enabled = false;
+ };
+ "org/gnome/desktop/wm/preferences" = {
+ audible-bell = false;
+ num-workspaces = 9;
+ };
+ "org/gnome/mutter" = {
+ dynamic-workspaces = false;
+ };
+ "org/gnome/shell/keybindings" = {
+ switch-to-application-1 = [];
+ switch-to-application-2 = [];
+ switch-to-application-3 = [];
+ switch-to-application-4 = [];
+ switch-to-application-5 = [];
+ switch-to-application-6 = [];
+ switch-to-application-7 = [];
+ switch-to-application-8 = [];
+ switch-to-application-9 = [];
+ };
+ "org/gnome/desktop/wm/keybindings" = {
+ switch-to-workspace-1 = ["1"];
+ switch-to-workspace-2 = ["2"];
+ switch-to-workspace-3 = ["3"];
+ switch-to-workspace-4 = ["4"];
+ switch-to-workspace-5 = ["5"];
+ switch-to-workspace-6 = ["6"];
+ switch-to-workspace-7 = ["7"];
+ switch-to-workspace-8 = ["8"];
+ switch-to-workspace-9 = ["9"];
+ move-to-workspace-1 = ["1"];
+ move-to-workspace-2 = ["2"];
+ move-to-workspace-3 = ["3"];
+ move-to-workspace-4 = ["4"];
+ move-to-workspace-5 = ["5"];
+ move-to-workspace-6 = ["6"];
+ move-to-workspace-7 = ["7"];
+ move-to-workspace-8 = ["8"];
+ move-to-workspace-9 = ["9"];
+ };
+ };
+}
diff --git a/modules/home/caem/development/default.nix b/modules/home/caem/development/default.nix
new file mode 100644
index 0000000..e4fb51f
--- /dev/null
+++ b/modules/home/caem/development/default.nix
@@ -0,0 +1,5 @@
+{ lib, ... }:
+
+{
+ imports = lib.getModuleImports ./.;
+}
diff --git a/modules/home/caem/development/emacs/default.nix b/modules/home/caem/development/emacs/default.nix
new file mode 100644
index 0000000..251fc83
--- /dev/null
+++ b/modules/home/caem/development/emacs/default.nix
@@ -0,0 +1,21 @@
+{ pkgs, config, ... }:
+
+let
+ # Has to be >= 29 due to treesitter
+ emacsPkg = "emacs30";
+in {
+ services.emacs = {
+ enable = true;
+ package = pkgs."${emacsPkg}";
+ defaultEditor = true;
+ };
+
+ programs.emacs = {
+ enable = true;
+ package = (pkgs."${emacsPkg}-pgtk".pkgs.withPackages (epkgs: [
+ epkgs.treesit-grammars.with-all-grammars
+ ]));
+ };
+
+ home.file."${config.xdg.configHome}/emacs".source = ./emacs.d;
+}
diff --git a/modules/home/caem/development/emacs/emacs.d/annoyances.el b/modules/home/caem/development/emacs/emacs.d/annoyances.el
new file mode 100644
index 0000000..28d2b3c
--- /dev/null
+++ b/modules/home/caem/development/emacs/emacs.d/annoyances.el
@@ -0,0 +1,9 @@
+(setq custom-file "/dev/null")
+
+(let ((backup_dir (concat (or (getenv "XDG_CACHE_HOME") "~/.cache") "/emacs_backups")))
+ (make-directory backup_dir t)
+ (setq backup-directory-alist '(("." . backup_dir))
+ backup-by-copying t))
+
+(setq inhibit-startup-message t)
+(setq auto-save-default nil)
diff --git a/modules/home/caem/development/emacs/emacs.d/appearance.el b/modules/home/caem/development/emacs/emacs.d/appearance.el
new file mode 100644
index 0000000..95235f5
--- /dev/null
+++ b/modules/home/caem/development/emacs/emacs.d/appearance.el
@@ -0,0 +1,18 @@
+(tool-bar-mode 0)
+(menu-bar-mode 0)
+(scroll-bar-mode 0)
+
+(setq display-line-numbers-type 'relative)
+(global-display-line-numbers-mode t)
+(global-hl-line-mode t)
+
+(set-frame-parameter nil 'alpha-background 90)
+(add-to-list 'default-frame-alist
+ '(font . "Go Mono Nerd Font-12"))
+
+;; Temporary theme. Replace later.
+(use-package darktooth-theme
+ :ensure t
+ :config
+ (load-theme 'darktooth-dark t)
+ (set-face-background 'hl-line "#262626")) ;; darktooth-background-0
diff --git a/modules/home/caem/development/emacs/emacs.d/completions.el b/modules/home/caem/development/emacs/emacs.d/completions.el
new file mode 100644
index 0000000..03f5eb5
--- /dev/null
+++ b/modules/home/caem/development/emacs/emacs.d/completions.el
@@ -0,0 +1,8 @@
+(ido-mode 1)
+(ido-everywhere 1)
+
+(use-package smex
+ :ensure t
+ :bind (("M-x" . smex)
+ ("M-X" . smex-major-mode-commands))
+ :config (smex-initialize))
diff --git a/modules/home/caem/development/emacs/emacs.d/formatting.el b/modules/home/caem/development/emacs/emacs.d/formatting.el
new file mode 100644
index 0000000..02f9ccd
--- /dev/null
+++ b/modules/home/caem/development/emacs/emacs.d/formatting.el
@@ -0,0 +1,15 @@
+(setq-default indent-tabs-mode nil)
+(setq-default tab-width 4)
+(setq indent-line-function 'insert-tab)
+(setq-default show-trailing-whitespace t)
+
+(use-package indent-bars
+ :ensure t
+ :hook (prog-mode . indent-bars-mode)
+ :custom
+ (indent-bars-display-on-blank-lines t)
+ (indent-bars-pattern " . . . ")
+ (indent-bars-color '("#7C6F64" :blend 0.2))
+ (indent-bars-width-frac 0.15)
+ (indent-bars-color-by-depth nil)
+ (indent-bars-highlight-current-depth '(:color "#DD6F48" :pattern "." :blend 0.4)))
diff --git a/modules/home/caem/development/emacs/emacs.d/init.el b/modules/home/caem/development/emacs/emacs.d/init.el
new file mode 100644
index 0000000..0929330
--- /dev/null
+++ b/modules/home/caem/development/emacs/emacs.d/init.el
@@ -0,0 +1,27 @@
+;; Set up paths so that emacs never touches ~/.config/emacs
+(let ((data-home (concat (or (getenv "XDG_DATA_HOME") "~/.local/share") "/emacs")))
+ (setq user-emacs-directory data-home
+ custom-file (expand-file-name "custom.el" data-home)
+ url-history-file (expand-file-name "url/history" data-home)
+ package-user-dir (expand-file-name "elpa" data-home)
+ boomark-default-file (expand-file-name "bookmarks" data-home)
+ recentf-save-file (expand-file-name "recentf" data-home)
+ tramp-persistent-file-name (expand-file-name "tramp" data-home)
+ auto-save-list-file-prefix (expand-file-name "auto-save-list/.saves-" data-home)
+ abbrev-file-name (expand-file-name "abbrev.el" data-home)
+ savehist-file (expand-file-name "savehist" data-home)
+ server-auth-dir (expand-file-name "server" data-home)
+ package-quickstart-file (expand-file-name "package-quickstart.elc" data-home)))
+(setq conf-home (concat (or (getenv "XDG_CONFIG_HOME") "~/.config") "/emacs"))
+
+(package-initialize)
+
+(require 'package)
+(add-to-list 'package-archives
+ '("melpa" . "https://melpa.org/packages/") t)
+
+(load (expand-file-name "./appearance.el" conf-home))
+(load (expand-file-name "./annoyances.el" conf-home))
+(load (expand-file-name "./completions.el" conf-home))
+(load (expand-file-name "./formatting.el" conf-home))
+(mapc 'load (file-expand-wildcards (expand-file-name "./languages/*.el" conf-home)))
diff --git a/modules/home/caem/development/emacs/emacs.d/languages/nix.el b/modules/home/caem/development/emacs/emacs.d/languages/nix.el
new file mode 100644
index 0000000..13528c6
--- /dev/null
+++ b/modules/home/caem/development/emacs/emacs.d/languages/nix.el
@@ -0,0 +1,11 @@
+(use-package nix-mode
+ :ensure t
+ :mode "\\.nix\\'")
+
+(use-package pretty-sha-path
+ :ensure t
+ :config (global-pretty-sha-path-mode 1))
+
+(add-hook 'nix-mode-hook
+ (lambda ()
+ (setq tab-width 2)))
diff --git a/modules/home/caem/development/ghostty.nix b/modules/home/caem/development/ghostty.nix
new file mode 100644
index 0000000..141aa9c
--- /dev/null
+++ b/modules/home/caem/development/ghostty.nix
@@ -0,0 +1,19 @@
+{ ... }:
+
+{
+ programs.ghostty = {
+ enable = true;
+ enableZshIntegration = true;
+ settings = let
+ literally_a_billion_million = 10000000000000;
+ in {
+ font-family = "Go Mono Nerd Font";
+ font-size = 12;
+ background-opacity = 0.85;
+ scrollback-limit = literally_a_billion_million;
+ theme = "Tomorrow Night Burns";
+ window-padding-x = 4;
+ window-padding-y = 4;
+ };
+ };
+}
diff --git a/modules/home/caem/development/git.nix b/modules/home/caem/development/git.nix
new file mode 100644
index 0000000..eca8086
--- /dev/null
+++ b/modules/home/caem/development/git.nix
@@ -0,0 +1,17 @@
+{ ... }:
+
+{
+ programs.git = {
+ enable = true;
+ userName = "caem";
+ userEmail = "me@caem.dev";
+ signing = {
+ signByDefault = true;
+ key = "E50FC66B5062070DC462661C69A830D03203405F";
+ };
+ extraConfig = {
+ pull.rebase = true;
+ init.defaultBranch = "master";
+ };
+ };
+}
diff --git a/modules/home/caem/multimedia/default.nix b/modules/home/caem/multimedia/default.nix
new file mode 100644
index 0000000..e4fb51f
--- /dev/null
+++ b/modules/home/caem/multimedia/default.nix
@@ -0,0 +1,5 @@
+{ lib, ... }:
+
+{
+ imports = lib.getModuleImports ./.;
+}
diff --git a/modules/home/caem/multimedia/games/default.nix b/modules/home/caem/multimedia/games/default.nix
new file mode 100644
index 0000000..e79c637
--- /dev/null
+++ b/modules/home/caem/multimedia/games/default.nix
@@ -0,0 +1,5 @@
+{ ... }:
+
+{
+
+}
diff --git a/modules/home/caem/multimedia/web/default.nix b/modules/home/caem/multimedia/web/default.nix
new file mode 100644
index 0000000..e4fb51f
--- /dev/null
+++ b/modules/home/caem/multimedia/web/default.nix
@@ -0,0 +1,5 @@
+{ lib, ... }:
+
+{
+ imports = lib.getModuleImports ./.;
+}
diff --git a/modules/home/caem/multimedia/web/firefox.nix b/modules/home/caem/multimedia/web/firefox.nix
new file mode 100644
index 0000000..d8147ea
--- /dev/null
+++ b/modules/home/caem/multimedia/web/firefox.nix
@@ -0,0 +1,5 @@
+{ ... }:
+
+{
+
+}
diff --git a/modules/home/caem/packages.nix b/modules/home/caem/packages.nix
new file mode 100644
index 0000000..2b2ac16
--- /dev/null
+++ b/modules/home/caem/packages.nix
@@ -0,0 +1,10 @@
+{ ... }:
+
+{
+ imports = [
+ ./development
+ ./core
+ ./desktop/gnome
+ ./multimedia
+ ];
+}
diff --git a/modules/nixos/communication/default.nix b/modules/nixos/communication/default.nix
new file mode 100644
index 0000000..4e5c81e
--- /dev/null
+++ b/modules/nixos/communication/default.nix
@@ -0,0 +1,22 @@
+{ pkgs, username, ... }:
+
+{
+ environment.systemPackages = with pkgs; [
+ tutanota-desktop
+ signal-desktop
+ element-desktop
+ vesktop
+ ];
+
+ environment.persistence."/nix/persist" = {
+ users."${username}" = {
+ directories = [
+ ".config/Signal"
+ ".config/vesktop"
+ ".config/tutanota-desktop"
+ ".config/tuta_integration"
+ ".config/Element"
+ ];
+ };
+ };
+}
diff --git a/modules/nixos/core/default.nix b/modules/nixos/core/default.nix
new file mode 100644
index 0000000..99b31f4
--- /dev/null
+++ b/modules/nixos/core/default.nix
@@ -0,0 +1,6 @@
+{ lib, ... }:
+
+{
+ imports = lib.getModuleImports ./.;
+}
+
diff --git a/modules/nixos/core/fonts.nix b/modules/nixos/core/fonts.nix
new file mode 100644
index 0000000..b2020bf
--- /dev/null
+++ b/modules/nixos/core/fonts.nix
@@ -0,0 +1,23 @@
+{ pkgs, ... }:
+
+{
+ fonts = {
+ packages = with pkgs; [
+ nerdfonts
+ ipafont
+ noto-fonts-emoji
+ cantarell-fonts
+ newcomputermodern
+ ];
+
+ fontconfig = {
+ enable = true;
+ cache32Bit = true;
+ subpixel.rgba = "rgb";
+ defaultFonts = {
+ monospace = [ "Go Mono Nerd Font" ];
+ };
+ };
+ };
+}
+
diff --git a/modules/nixos/core/impermanence.nix b/modules/nixos/core/impermanence.nix
new file mode 100644
index 0000000..4f2aee5
--- /dev/null
+++ b/modules/nixos/core/impermanence.nix
@@ -0,0 +1,42 @@
+{ config, lib, ... }:
+
+{
+ /* Required to be able to allowOther on user persisted directories */
+ programs.fuse.userAllowOther = true;
+
+ boot.initrd.postDeviceCommands = lib.mkAfter ''
+ mkdir /btrfs_tmp
+ mount "${config.fileSystems."/".device}" /btrfs_tmp
+ if [[ -e /btrfs_tmp/root ]]; then
+ mkdir -p /btrfs_tmp/old_roots
+ timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
+ mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
+ fi
+
+ delete_subvolume_recursively() {
+ IFS=$'\n'
+ for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
+ delete_subvolume_recursively "/btrfs_tmp/$i"
+ done
+ btrfs subvolume delete "$1"
+ }
+
+ for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do
+ delete_subvolume_recursively "$i"
+ done
+
+ btrfs subvolume create /btrfs_tmp/root
+ umount /btrfs_tmp
+ '';
+
+ environment.persistence."/nix/persist" = {
+ hideMounts = true;
+ directories = [
+ "/var/log"
+ "/var/lib/nixos"
+ ];
+ files = [
+ "/etc/machine-id"
+ ];
+ };
+}
diff --git a/modules/nixos/core/nix.nix b/modules/nixos/core/nix.nix
new file mode 100644
index 0000000..1bbecfa
--- /dev/null
+++ b/modules/nixos/core/nix.nix
@@ -0,0 +1,28 @@
+{ pkgs, lib, inputs, cfgPath, ... }:
+
+let
+ importOverlays = builtins.map
+ (overlay: import overlay { inherit lib inputs pkgs cfgPath; })
+ (builtins.filter
+ (file: builtins.match ".*\.nix" (builtins.toString file) != null)
+ (lib.filesystem.listFilesRecursive "${cfgPath}/overlays"));
+in {
+ nix = {
+ settings = {
+ auto-optimise-store = true;
+ use-xdg-base-directories = true;
+ trusted-users = [ "@wheel" ];
+ allowed-users = [ "@wheel" ];
+ };
+ extraOptions = ''
+ experimental-features = nix-command flakes
+ '';
+ };
+ nixpkgs = {
+ config = {
+ allowUnfree = true;
+ };
+ hostPlatform = lib.mkDefault "x86_64-linux";
+ overlays = importOverlays;
+ };
+}
diff --git a/modules/nixos/core/security.nix b/modules/nixos/core/security.nix
new file mode 100644
index 0000000..41447b2
--- /dev/null
+++ b/modules/nixos/core/security.nix
@@ -0,0 +1,51 @@
+{ username, ... }:
+
+{
+ programs.gnupg.agent = {
+ enable = true;
+ enableSSHSupport = true;
+ };
+
+ /*
+ * Sudo is scheduled to be replaced by systemd's run0.
+ * The blocker for this is persistent authentication support.
+ *
+ * https://github.com/systemd/systemd/issues/33366
+ * https://github.com/polkit-org/polkit/issues/472
+ */
+ security.sudo = {
+ enable = true;
+ execWheelOnly = true;
+ extraConfig = ''
+ Defaults lecture="never"
+ '';
+ };
+
+ security.apparmor.enable = true;
+ networking.firewall.enable = true;
+
+ /* Disable the root user */
+ users = {
+ users.root.hashedPassword = "!";
+ mutableUsers = false;
+ };
+
+ sops.age.keyFile = "/nix/config/keys.txt";
+
+ environment.persistence."/nix/persist" = {
+ files = [
+ "/root/.ssh/known_hosts"
+ ];
+ users."${username}".directories = let
+ baseAttrs = {
+ user = "${username}";
+ group = "users";
+ mode = "u=rwx,g=,o=";
+ };
+ in [
+ (baseAttrs // { directory = ".ssh"; })
+ (baseAttrs // { directory = ".local/share/gnupg"; })
+ (baseAttrs // { directory = ".local/share/keyrings"; })
+ ];
+ };
+}
diff --git a/modules/nixos/core/systemd.nix b/modules/nixos/core/systemd.nix
new file mode 100644
index 0000000..0738be6
--- /dev/null
+++ b/modules/nixos/core/systemd.nix
@@ -0,0 +1,8 @@
+{ ... }:
+
+{
+ /* https://files.catbox.moe/s5diss.mp4 */
+ systemd.extraConfig = ''
+ DefaultTimeoutStopSpec=5s
+ '';
+}
diff --git a/modules/nixos/core/zsh.nix b/modules/nixos/core/zsh.nix
new file mode 100644
index 0000000..291dbf9
--- /dev/null
+++ b/modules/nixos/core/zsh.nix
@@ -0,0 +1,10 @@
+{ ... }:
+
+{
+ programs.zsh = {
+ enable = true;
+ shellInit = ''
+ export ZDOTDIR=$HOME/.config/zsh
+ '';
+ };
+}
diff --git a/modules/nixos/desktop/gnome/default.nix b/modules/nixos/desktop/gnome/default.nix
new file mode 100644
index 0000000..7563256
--- /dev/null
+++ b/modules/nixos/desktop/gnome/default.nix
@@ -0,0 +1,62 @@
+{ pkgs, username, ... }:
+
+{
+ services.xserver = {
+ enable = false;
+ displayManager.gdm.enable = true;
+ desktopManager.gnome.enable = true;
+ };
+
+ environment.gnome.excludePackages = with pkgs; [
+ orca
+ geary
+ gnome-disk-utility
+ gnome-backgrounds
+ gnome-user-docs
+ epiphany
+ yelp
+ gnome-software
+ totem
+ snapshot
+ simple-scan
+ gnome-console
+ gnome-text-editor
+ gnome-tour
+ gnome-bluetooth
+ gnome-music
+ gnome-maps
+ gnome-contacts
+ gnome-calendar
+ gnome-connections
+ ];
+
+ environment.systemPackages = with pkgs; [
+ ghostty
+ dconf-editor
+ ] ++ (with pkgs.gnomeExtensions; [
+ caffeine
+ accent-directories
+ just-perfection
+ quick-settings-tweaker
+ forge
+ ]);
+
+ environment.persistence."/nix/persist" = {
+ directories = [
+ "/var/lib/AccountsService"
+ ];
+ users."${username}" = {
+ directories = [
+ ".config/dconf"
+
+ # Right now I don't really modify much here other than the tab group tab colour
+ # but I might in the future want to manage these files using home-manager instead
+ # of having them set imperatively and simply persisted.
+ ".config/forge"
+ ];
+ files = [
+ ".config/monitors.xml"
+ ];
+ };
+ };
+}
diff --git a/modules/nixos/development/default.nix b/modules/nixos/development/default.nix
new file mode 100644
index 0000000..6c469ae
--- /dev/null
+++ b/modules/nixos/development/default.nix
@@ -0,0 +1,9 @@
+{ username, ... }:
+
+{
+ environment.persistence."/nix/persist" = {
+ users."${username}".directories = [
+ ".local/share/emacs"
+ ];
+ };
+}
\ No newline at end of file
diff --git a/modules/nixos/hardware/audio/default.nix b/modules/nixos/hardware/audio/default.nix
new file mode 100644
index 0000000..856e70a
--- /dev/null
+++ b/modules/nixos/hardware/audio/default.nix
@@ -0,0 +1,54 @@
+{ ... }:
+
+{
+ boot.kernelParams = [ "preempt=full" ];
+ security.rtkit.enable = true;
+ services.pipewire = {
+ enable = true;
+ alsa = {
+ enable = true;
+ support32Bit = true;
+ };
+ pulse.enable = true;
+ jack.enable = true;
+
+ # Reduce latency
+ # https://wiki.nixos.org/wiki/PipeWire#Low-latency_setup
+ extraConfig = let
+ rate = builtins.toString 48000;
+
+ # The default value in the wiki is 32 but might result in crackling audio.
+ # If you get audio crackling try increasing this value until it's gone.
+ quantum = builtins.toString 128;
+ in {
+ pipewire."92-low-latency" = {
+ "context.properties" = {
+ "default.clock.rate" = "${rate}";
+ "default.clock.quantum" = "${quantum}";
+ "default.clock.min-quantum" = "${quantum}";
+ "default.clock.max-quantum" = "${quantum}";
+ };
+ };
+
+ pipewire-pulse."92-low-latency" = {
+ "context.properties" = [
+ {
+ name = "libpipewire-module-protocol-pulse";
+ args = { };
+ }
+ ];
+ "pulse.properties" = {
+ "pulse.min.req" = "${quantum}/${rate}";
+ "pulse.default.req" = "${quantum}/${rate}";
+ "pulse.max.req" = "${quantum}/${rate}";
+ "pulse.min.quantum" = "${quantum}/${rate}";
+ "pulse.max.quantum" = "${quantum}/${rate}";
+ };
+ "stream.properties" = {
+ "node.latency" = "${quantum}/${rate}";
+ "resample.quality" = 1;
+ };
+ };
+ };
+ };
+}
diff --git a/modules/nixos/hardware/cpu/amd/default.nix b/modules/nixos/hardware/cpu/amd/default.nix
new file mode 100644
index 0000000..c46d798
--- /dev/null
+++ b/modules/nixos/hardware/cpu/amd/default.nix
@@ -0,0 +1,11 @@
+{ pkgs, ... }:
+
+{
+ boot = {
+ kernelModules = [ "kvm-amd" ];
+ extraModprobeConfig = "options kvm_amd nested=1";
+ };
+
+ hardware.cpu.amd.updateMicrocode = true;
+ hardware.firmware = with pkgs; [ linux-firmware ];
+}
diff --git a/modules/nixos/hardware/gpu/graphics.nix b/modules/nixos/hardware/gpu/graphics.nix
new file mode 100644
index 0000000..87d60ec
--- /dev/null
+++ b/modules/nixos/hardware/gpu/graphics.nix
@@ -0,0 +1,9 @@
+{ ... }:
+{
+ hardware = {
+ graphics = {
+ enable = true;
+ enable32Bit = true;
+ };
+ };
+}
diff --git a/modules/nixos/hardware/gpu/nvidia/default.nix b/modules/nixos/hardware/gpu/nvidia/default.nix
new file mode 100644
index 0000000..e993d7d
--- /dev/null
+++ b/modules/nixos/hardware/gpu/nvidia/default.nix
@@ -0,0 +1,44 @@
+{ config, ... }:
+
+{
+ imports = [
+ ../graphics.nix
+ ];
+
+ hardware = {
+ nvidia = {
+ open = true;
+ modesetting.enable = true;
+ package = config.boot.kernelPackages.nvidiaPackages.beta;
+ nvidiaSettings = false;
+ };
+ };
+
+ boot.kernelParams = [
+ "nvidia_drm.fbdev=1"
+ "nvidia.NVreg_PreserveVideoMemoryAllocations=1"
+ ];
+
+ services.xserver.videoDrivers = [ "nvidia" ];
+
+ environment.sessionVariables = {
+ LIBVA_DRIVER_NAME = "nvidia";
+ GBM_BACKEND = "nvidia-drm";
+ __GLX_VENDOR_LIBRARY_NAME = "nvidia";
+ NVD_BACKEND = "direct";
+ NIXOS_OZONE_WL = 1;
+ };
+
+ nixpkgs.config.cudaSupport = true;
+ nix = {
+ settings = {
+ substituters = [
+ "https://nix-community.cachix.org"
+ ];
+ trusted-public-keys = [
+ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
+ ];
+ };
+ };
+}
+
diff --git a/modules/nixos/multimedia/art/default.nix b/modules/nixos/multimedia/art/default.nix
new file mode 100644
index 0000000..977f21c
--- /dev/null
+++ b/modules/nixos/multimedia/art/default.nix
@@ -0,0 +1,15 @@
+{ pkgs, username, ... }:
+
+{
+ environment.persistence."/nix/persist" = {
+ users."${username}".directories = [
+ ".local/share/krita"
+ ".config/GIMP"
+ ];
+ };
+
+ environment.systemPackages = with pkgs; [
+ krita
+ gimp
+ ];
+}
diff --git a/modules/nixos/multimedia/default.nix b/modules/nixos/multimedia/default.nix
new file mode 100644
index 0000000..e4fb51f
--- /dev/null
+++ b/modules/nixos/multimedia/default.nix
@@ -0,0 +1,5 @@
+{ lib, ... }:
+
+{
+ imports = lib.getModuleImports ./.;
+}
diff --git a/modules/nixos/multimedia/games/default.nix b/modules/nixos/multimedia/games/default.nix
new file mode 100644
index 0000000..fde8866
--- /dev/null
+++ b/modules/nixos/multimedia/games/default.nix
@@ -0,0 +1,21 @@
+{ pkgs, username, ... }:
+
+{
+ environment.persistence."/nix/persist" = {
+ users."${username}".directories = [
+ ".local/share/steam_home"
+ ".local/share/osu"
+ ];
+ };
+
+ environment.systemPackages = with pkgs; [
+ protonup-qt
+ protontricks
+ unstable.osu-lazer-bin
+ ];
+
+ programs.steam = {
+ enable = true;
+ gamescopeSession.enable = true;
+ };
+}
diff --git a/modules/nixos/multimedia/music/default.nix b/modules/nixos/multimedia/music/default.nix
new file mode 100644
index 0000000..e4fb51f
--- /dev/null
+++ b/modules/nixos/multimedia/music/default.nix
@@ -0,0 +1,5 @@
+{ lib, ... }:
+
+{
+ imports = lib.getModuleImports ./.;
+}
diff --git a/modules/nixos/multimedia/music/tidal.nix b/modules/nixos/multimedia/music/tidal.nix
new file mode 100644
index 0000000..f98f8ea
--- /dev/null
+++ b/modules/nixos/multimedia/music/tidal.nix
@@ -0,0 +1,13 @@
+{ pkgs, username, ... }:
+
+{
+ environment.systemPackages = with pkgs; [
+ tidal-hifi
+ ];
+
+ environment.persistence."/nix/persist" = {
+ users."${username}".directories = [
+ ".config/tidal-hifi"
+ ];
+ };
+}
diff --git a/modules/nixos/multimedia/web/default.nix b/modules/nixos/multimedia/web/default.nix
new file mode 100644
index 0000000..e4fb51f
--- /dev/null
+++ b/modules/nixos/multimedia/web/default.nix
@@ -0,0 +1,5 @@
+{ lib, ... }:
+
+{
+ imports = lib.getModuleImports ./.;
+}
diff --git a/modules/nixos/multimedia/web/firefox/default.nix b/modules/nixos/multimedia/web/firefox/default.nix
new file mode 100644
index 0000000..dc9c46e
--- /dev/null
+++ b/modules/nixos/multimedia/web/firefox/default.nix
@@ -0,0 +1,14 @@
+{ username, pkgs, ... }:
+
+{
+ environment.systemPackages = with pkgs; [
+ tor-browser
+ firefox-esr
+ ];
+
+ environment.persistence."/nix/persist" = {
+ users."${username}".directories = [
+ ".config/mozilla"
+ ];
+ };
+}
diff --git a/modules/nixos/multimedia/web/firefox/policies.nix b/modules/nixos/multimedia/web/firefox/policies.nix
new file mode 100644
index 0000000..d1c765e
--- /dev/null
+++ b/modules/nixos/multimedia/web/firefox/policies.nix
@@ -0,0 +1,72 @@
+{
+ EnableTrackingProtection = {
+ Value = true;
+ Cryptomining = true;
+ Fingerprinting = true;
+ EmailTracking = true;
+ Level = "strict";
+ };
+
+ DisableTelemetry = true;
+ DisablePocket = true;
+ DisableFirefoxStudies = true;
+ DisableFirefoxAccounts = false;
+ DisableAccounts = false;
+ DontCheckDefaultBrowser = true;
+ OverrideFirstRunPage = "";
+ OverridePostUpdatePage = "";
+ NoDefaultBookmarks = true;
+ Cookies = {
+ Behaviour = "reject-foreign";
+ BehaviourPrivateBrowsing = "reject-foreign";
+ };
+
+ UserMessaging = {
+ WhatsNew = false;
+ ExtensionRecommendations = false;
+ FeatureRecommendations = false;
+ UrlbarInterventions = false;
+ UrlbarTopSitesEnabled = false;
+ SkipOnboarding = true;
+ MoreFromMozilla = false;
+ };
+
+ FirefoxHome = {
+ Search = false;
+ TopSites = false;
+ SponsoredTopSites = false;
+ Highlights = false;
+ Pocket = false;
+ SponsoredPocket = false;
+ Snippets = false;
+ Locked = true;
+ };
+
+ SearchSuggestEnabled = false;
+ NewTabPage = false;
+
+ SearchEngines = { # ESR only
+ Default = "Kagi";
+ PreventInstalls = true;
+ DisableSearchEngineUpdate = true;
+ Remove = ["Google" "Bing" "Amazon.com" "DuckDuckGo"
+ "eBay" "Twitter" "Wikipedia (en)"];
+ Add = [
+ {
+ Name = "Kagi";
+ URLTemplate = "https://kagi.com/search?q={searchTerms}";
+ Method = "GET";
+ IconURL = "https://kagi.com/favicon.ico";
+ Alias = "@k";
+ Default = true;
+ }
+ ];
+ };
+
+ FirefoxSuggest = {
+ WebSuggestions = false;
+ SponsoredSuggestions = false;
+ ImproveSuggest = false;
+ Locked = true;
+ };
+}
diff --git a/modules/nixos/multimedia/web/firefox/preferences.nix b/modules/nixos/multimedia/web/firefox/preferences.nix
new file mode 100644
index 0000000..6343023
--- /dev/null
+++ b/modules/nixos/multimedia/web/firefox/preferences.nix
@@ -0,0 +1,23 @@
+let
+ prefToString = value:
+ if builtins.isBool value then
+ if value then "true" else "false"
+ else if (builtins.isInt value) || (builtins.isNull value) then
+ builtins.toString value
+ else if builtins.isString value then
+ ''"${value}"''
+ else
+ builtins.throw
+ "Pref expected one of (Bool, String, Int, Null) got instead ${builtins.typeOf value}";
+
+ mkPrefs = prefs: builtins.concatStringsSep
+ "\n"
+ (builtins.attrValues
+ (builtins.mapAttrs
+ (n: v: ''pref("${n}", ${prefToString v});'') prefs));
+in
+ mkPrefs {
+ "browser.urlbar.suggest.topsites" = false;
+ "browser.startup.homepage" = "about:blank";
+ "browser.download.useDownloadDir" = false;
+ }
diff --git a/modules/nixos/user/caem.nix b/modules/nixos/user/caem.nix
new file mode 100644
index 0000000..4046513
--- /dev/null
+++ b/modules/nixos/user/caem.nix
@@ -0,0 +1,32 @@
+{ config, pkgs, inputs, ... }:
+
+{
+ sops.secrets.upasswd = {
+ neededForUsers = true;
+ sopsFile = inputs.secrets.paths.upasswd;
+ };
+
+ environment.persistence."/nix/persist" = {
+ users.caem = {
+ directories = [
+ "documents"
+ "download"
+ "music"
+ "images"
+ "videos"
+ "programming"
+ ];
+ };
+ };
+
+ users.users.caem = {
+ isNormalUser = true;
+ shell = pkgs.zsh;
+ hashedPasswordFile = config.sops.secrets.upasswd.path;
+ extraGroups = [
+ "wheel"
+ ];
+ };
+
+ home-manager.users.caem = import ../../home/caem;
+}
diff --git a/modules/packages/fastfetch.nix b/modules/packages/fastfetch.nix
deleted file mode 100644
index b6589ba..0000000
--- a/modules/packages/fastfetch.nix
+++ /dev/null
@@ -1,30 +0,0 @@
-{ ... }:
-
-{
- home-manager.users.hu = {
- programs.fastfetch = {
- enable = true;
- settings = {
- modules = [
- "title"
- "separator"
- "os"
- "kernel"
- "initsystem"
- "uptime"
- "datetime"
- "packages"
- "terminal"
- "wm"
- "shell"
- "cpu"
- "gpu"
- "memory"
- "break"
- "colors"
- ];
- };
- };
- };
-}
-
diff --git a/modules/packages/firefox.nix b/modules/packages/firefox.nix
deleted file mode 100644
index 2119757..0000000
--- a/modules/packages/firefox.nix
+++ /dev/null
@@ -1,272 +0,0 @@
-{ pkgs, ... }:
-
-# You could theoretically, like I did for a while, maintain this file
-# to manage your Firefox and waste your time on this or you could just use
-# Firefox accounts and become a functioning member of society. This file is
-# now only a starting point and will not be kept up to date with my setup.
-
-{
- environment.persistence."/nix/persist".users.hu.directories = [
- ".mozilla/firefox/shaga"
- ];
-
- home-manager.users.hu = {
- programs.firefox = {
- enable = true;
- package = pkgs.firefox-esr;
- policies = {
- EnableTrackingProtection = {
- Value = true;
- Cryptomining = true;
- Fingerprinting = true;
- EmailTracking = true;
- };
- DisableTelemetry = true;
- DisablePocket = true;
- DisableFirefoxStudies = true;
- DisableFirefoxAccounts = false;
- DisableAccounts = false;
- DontCheckDefaultBrowser = true;
- OverrideFirstRunPage = "";
- OverridePostUpdatePage = "";
- NoDefaultBookmarks = true;
- Cookies = {
- Behaviour = "reject-foreign";
- BehaviourPrivateBrowsing = "reject-foreign";
- };
-
- SearchEngines = { # ESR only
- Remove = [ "Bing" "Google" "DuckDuckGo" "Wikipedia (en)" ];
- };
-
- # https://discourse.nixos.org/t/declare-firefox-extensions-and-settings/36265/17
- ExtensionSettings = with builtins;
- let extension = shortId: uuid: {
- name = uuid;
- value = {
- install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi";
- installation_mode = "normal_installed";
- };
- };
- in listToAttrs [
- (extension "ublock-origin" "uBlock0@raymondhill.net")
- ];
-
- "3rdparty".Extensions = {
- "uBlock0@raymondhill.net".adminSettings = {
- userSettings = {
- importedLists = [
- "https://raw.githubusercontent.com/DandelionSprout/adfilt/master/LegitimateURLShortener.txt"
- ];
- externalLists = "https://raw.githubusercontent.com/DandelionSprout/adfilt/master/LegitimateURLShortener.txt";
- };
- selectedFilterLists = [
- "https://raw.githubusercontent.com/DandelionSprout/adfilt/master/LegitimateURLShortener.txt"
- "user-filters" "ublock-filters" "ublock-badware" "ublock-privacy" "ublock-quick-fixes"
- "ublock-unbreak" "easylist" "adguard-generic" "adguard-mobile" "easyprivacy" "adguard-spyware"
- "adguard-spyware-url" "block-lan" "urlhaus-1" "curben-phishing" "plowe-0" "dpollock-0" "fanboy-cookiemonster"
- "ublock-cookies-easylist" "adguard-cookies" "ublock-cookies-adguard" "fanboy-social" "adguard-social"
- "fanboy-thirdparty_social" "easylist-chat" "easylist-newsletters" "easylist-notifications"
- "easylist-annoyances" "adguard-mobile-app-banners" "adguard-other-annoyances" "adguard-popup-overlays"
- "adguard-widgets" "ublock-annoyances" "ALB-0" "BGR-0" "CHN-0" "CZE-0" "DEU-0" "EST-0" "ara-0" "spa-1"
- "spa-0" "FIN-0" "FRA-0" "GRC-0" "HRV-0" "HUN-0" "IDN-0" "ISR-0" "IND-0" "IRN-0" "ISL-0" "ITA-0"
- "JPN-1" "KOR-1" "LTU-0" "LVA-0" "MKD-0" "NLD-0" "NOR-0" "POL-0" "POL-2" "ROU-1" "RUS-0" "SWE-1"
- "SVN-0" "THA-0" "TUR-0" "VIE-1"
- ];
- };
- };
- };
-
- profiles.shaga = {
- isDefault = true;
- search = {
- force = true;
- default = "Kagi";
- order = [ "Kagi" "Gruble" "Nix Packages" "Nix Options" "Home-manager options" ];
- engines = {
- "Kagi" = {
- urls = [
- {
- template = "https://kagi.com/search";
- params = [
- { name = "q"; value = "{searchTerms}"; }
- ];
- }
- ];
- iconUpdateURL = "https://kagi.com/favicon.ico";
- updateInterval = 7 * 24 * 60 * 60 * 1000; # Weekly
- definedAliases = [ "@k" ];
- };
- "Gruble" = {
- urls = [
- {
- template = "https://gruble.de/search";
- params = [
- { name = "q"; value = "{searchTerms}"; }
- ];
- }
- ];
- iconUpdateURL = "https://gruble.de/favicon.ico";
- updateInterval = 7 * 24 * 60 * 60 * 1000; # Weekly
- definedAliases = [ "@g" ];
- };
- "Nix Packages" = {
- urls = [{
- template = "https://search.nixos.org/packages";
- params = [
- { name = "type"; value = "packages"; }
- { name = "channel"; value = "unstable"; }
- { name = "query"; value = "{searchTerms}"; }
- ];
- }];
- iconUpdateURL = "https://nixos.org/favicon.png";
- updateInterval = 7 * 24 * 60 * 60 * 1000; # Weekly
- definedAliases = [ "@np" ];
- };
- "Nix Options" = {
- urls = [{
- template = "https://search.nixos.org/options";
- params = [
- { name = "type"; value = "packages"; }
- { name = "channel"; value = "unstable"; }
- { name = "query"; value = "{searchTerms}"; }
- ];
- }];
- iconUpdateURL = "https://nixos.org/favicon.png";
- updateInterval = 7 * 24 * 60 * 60 * 1000; # Weekly
- definedAliases = [ "@no" ];
- };
- "Home-manager options" = {
- urls = [{
- template = "https://home-manager-options.extranix.com";
- params = [
- { name = "release"; value = "master"; }
- { name = "query"; value = "{searchTerms}"; }
- ];
- }];
- iconUpdateURL = "https://home-manager-options.extranix.com/images/favicon.png";
- updateInterval = 7 * 24 * 60 * 60 * 1000; # Weekly
- definedAliases = [ "@ho" ];
- };
- };
- };
-
- settings = {
- "browser.urlbar.quicksuggest.contextualOptIn.topPosition" = false;
- "extensions.postDownloadThirdPartyPrompt" = false;
- "extensions.getAddons.cache.enabled" = false;
- "browser.search.update" = false;
- "extensions.autoDisableScopes" = 0;
- "browser.startup.page" = 0;
- "browser.startup.homepage" = "about:blank";
- "browser.newtabpage.enabled" = false;
- "browser.newtabpage.activity-stream.showSponsored" = false;
- "browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
- "browser.newtabpage.activity-stream.default.sites" = "";
- "geo.provider.use_gpsd" = false;
- "extensions.getAddons.showPane" = false;
- "htmlaboutaddons.recommendations.enabled" = false;
- "discovery.enabled" = false;
- "browser.shopping.experience2023.enabled" = false;
- "app.shield.optoutstudies.enabled" = false;
- "app.normandy.enabled" = false;
- "app.normandy.api_url" = "";
- "breakpad.reportURL" = "";
- "browser.newtabpage.activity-stream.feeds.telemetry" = false;
- "browser.newtabpage.activity-stream.telemetry" = false;
- "browser.search.serpEventTelemetry.enabled" = false;
- "dom.security.unexpected_system_load_telemetry_enabled" = false;
- "network.trr.confirmation_telemetry_enabled" = false;
- "security.app_menu.recordEventTelemetry" = false;
- "security.certerrors.recordEventTelemetry" = false;
- "security.protectionspopup.recordEventTelemetry" = false;
- "toolkit.telemetry.bhrPing.enabled" = false;
- "toolkit.telemetry.firstShutdownPing.enabled" = false;
- "toolkit.telemetry.newProfilePing.enabled" = false;
- "toolkit.telemetry.pioneer-new-studies-available" = false;
- "toolkit.telemetry.shutdownPingSender.enabled" = false;
- "toolkit.telemetry.unified" = false;
- "toolkit.telemetry.updatePing.enabled" = false;
- "toolkit.telemetry.server" = "127.0.0.1";
- "browser.newtabpage.activity-stream.telemetry.structuredIngestion.endpoint" = "127.0.0.1";
- "browser.tabs.crashReporting.sendReport" = false;
- "browser.crashReports.unsubmittedCheck.autoSubmit2" = false;
- "captivedetect.canonicalURL" = "";
- "network.captive-portal-service.enabled" = false;
- "network.connectivity-service.enabled" = false;
- "browser.safebrowsing.downloads.remote.enabled" = false;
- "browser.urlbar.speculativeConnect.enabled" = false;
- "browser.search.suggest.enabled" = true;
- "browser.urlbar.suggest.quicksuggest.nonsponsored" = false;
- "browser.urlbar.suggest.quicksuggest.sponsored" = false;
- "browser.urlbar.suggest.searches" = true;
- "browser.urlbar.suggest.bookmark" = false;
- "browser.urlbar.suggest.addons" = false;
- "browser.urlbar.suggest.calculator" = false;
- "browser.urlbar.suggest.clipboard" = false;
- "browser.urlbar.suggest.engines" = false;
- "browser.urlbar.suggest.history" = false;
- "browser.urlbar.suggest.mdn" = false;
- "browser.urlbar.suggest.openpage" = false;
- "browser.urlbar.suggest.pocket" = false;
- "browser.urlbar.suggest.recentsearches" = false;
- "browser.urlbar.suggest.remotetab" = false;
- "browser.urlbar.suggest.topsites" = false;
- "browser.urlbar.suggest.trending" = false;
- "browser.urlbar.suggest.weather" = false;
- "browser.urlbar.suggest.yelp" = false;
- "browser.urlbar.richSuggestions.tail" = false;
- "browser.urlbar.quicksuggest.shouldShowOnboardingDialog" = false;
- "browser.urlbar.quicksuggest.rustEnabled" = false;
- "browser.urlbar.richSuggestions.featureGate" = false;
- "browser.urlbar.trending.featureGate" = false;
- "browser.urlbar.addons.featureGate" = false;
- "browser.urlbar.mdn.featureGate" = false;
- "browser.urlbar.pocket.featureGate" = false;
- "browser.urlbar.weather.featureGate" = false;
- "browser.formfill.enable" = false;
- "dom.forms.autocomplete.formautofill" = false;
- "extensions.formautofill.addresses.capture.enabled" = false;
- "extensions.formautofill.creditCards.enabled" = false;
- "signon.autofillForms" = false;
- "signon.rememberSignons" = false;
- "signon.formlessCapture.enabled" = false;
- "network.auth.subresource-http-auth-allow" = 1;
- "dom.security.https_only_mode" = true;
- "network.http.referer.XOriginTrimmingPolicy" = 2;
- "privacy.userContext.enabled" = true;
- "privacy.userContext.ui.enabled" = true;
- "privacy.sanitize.sanitizeOnShutdown" = true;
- "privacy.clearHistory.siteSettings" = true;
- "media.peerconnection.ice.no_host" = true;
- "browser.download.start_downloads_in_tmp_dir" = true;
- "browser.helperApps.deleteTempFileOnExit" = true;
- "browser.uitour.enabled" = false;
- "pdfjs.enableScripting" = false;
- "browser.download.useDownloadDir" = false;
- "browser.download.alwaysOpenPanel" = true;
- "browser.download.manager.addToRecentDocs" = false;
- "browser.download.always_ask_before_handling_new_types" = true;
- "browser.contentblocking.category" = "strict";
- "privacy.clearOnShutdown.cache" = true;
- "privacy.clearOnShutdown.downloads" = true;
- "privacy.clearOnShutdown.formdata" = true;
- "privacy.clearOnShutdown.history" = true;
- "privacy.clearOnShutdown.sessions" = true;
- "privacy.clearOnShutdown.cookies" = true;
- "privacy.clearOnShutdown.offlineApps" = true;
- "privacy.clearSiteData.historyFormDataAndDownloads" = true;
- "browser.startup.homepage_override.mstone" = "ignore";
- "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons" = false;
- "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features" = false;
- "extensions.activeThemeID" = "firefox-compact-dark@mozilla.org";
- "browser.messaging-system.whatsNewPanel.enabled" = false;
- "browser.urlbar.showSearchTerms.enabled" = false;
- "browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts.havePinned" = "";
- "browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts.searchEngines" = "";
- };
- };
- };
- };
-}
-
diff --git a/modules/packages/foot.nix b/modules/packages/foot.nix
deleted file mode 100644
index 2842d72..0000000
--- a/modules/packages/foot.nix
+++ /dev/null
@@ -1,54 +0,0 @@
-{ ... }:
-
-{
- home-manager.users.hu = {
- programs.foot = {
- enable = true;
- settings = {
- main = {
- pad = "2x2 center";
- font = "Go Mono Nerd Font:size=12";
- };
-
- mouse = {
- hide-when-typing = "yes";
- };
-
- scrollback = {
- lines = 10000;
- };
-
- colors = {
- alpha = 0.9;
-
- foreground = "c5c9c5";
- background = "181616";
- selection-foreground = "c8c093";
- selection-background = "2d4f67";
-
- regular0 = "0d0c0c";
- regular1 = "c4746e";
- regular2 = "8a9a7b";
- regular3 = "c4b28a";
- regular4 = "8ba4b0";
- regular5 = "a292a3";
- regular6 = "8ea4a2";
- regular7 = "c8c093";
-
- bright0 = "a6a69c";
- bright1 = "e46876";
- bright2 = "87a987";
- bright3 = "e6c384";
- bright4 = "7fb4ca";
- bright5 = "938aa9";
- bright6 = "7aa89f";
- bright7 = "c5c9c5";
-
- "16" = "b6927b";
- "17" = "b98d7b";
- };
- };
- };
- };
-}
-
diff --git a/modules/packages/git.nix b/modules/packages/git.nix
deleted file mode 100644
index b0d49ba..0000000
--- a/modules/packages/git.nix
+++ /dev/null
@@ -1,49 +0,0 @@
-{ pkgs, ... }:
-
-let
- ugp = "/nix/config/secrets/git_uni";
-in {
- home-manager.users.hu = {
- home.file."/home/hu/.config/git/personal" = {
- text = ''
- [user]
- email = "me@caem.dev"
- name = "caem"
- signingKey = "E50FC66B5062070DC462661C69A830D03203405F"
-
- [gpg]
- program = "${pkgs.gnupg}/bin/gpg2"
-
- [commit]
- gpgSign = true
-
- [tag]
- gpgSign = true
-
- [init]
- defaultBranch = "master"
-
- [pull]
- rebase = true
- '';
- };
-
- home.file."/home/hu/.config/git/uni" = {
- source = ugp;
- };
-
- home.file."/home/hu/.config/git/config" = {
- text = ''
- [includeIf "gitdir:~/programming/personal/**"]
- path = ~/.config/git/personal
-
- [includeIf "gitdir:~/programming/forks/**"]
- path = ~/.config/git/personal
-
- [includeIf "gitdir:~/programming/uni/**"]
- path = ~/.config/git/uni
- '';
- };
- };
-}
-
diff --git a/modules/packages/konsole/custom.colorscheme b/modules/packages/konsole/custom.colorscheme
deleted file mode 100644
index f1a3bcf..0000000
--- a/modules/packages/konsole/custom.colorscheme
+++ /dev/null
@@ -1,100 +0,0 @@
-[Background]
-Color=35,38,39
-
-[BackgroundFaint]
-Color=49,54,59
-
-[BackgroundIntense]
-Color=0,0,0
-
-[Color0]
-Color=35,38,39
-
-[Color0Faint]
-Color=49,54,59
-
-[Color0Intense]
-Color=127,140,141
-
-[Color1]
-Color=237,21,21
-
-[Color1Faint]
-Color=120,50,40
-
-[Color1Intense]
-Color=192,57,43
-
-[Color2]
-Color=17,209,22
-
-[Color2Faint]
-Color=23,162,98
-
-[Color2Intense]
-Color=28,220,154
-
-[Color3]
-Color=246,116,0
-
-[Color3Faint]
-Color=182,86,25
-
-[Color3Intense]
-Color=253,188,75
-
-[Color4]
-Color=29,153,243
-
-[Color4Faint]
-Color=27,102,143
-
-[Color4Intense]
-Color=61,174,233
-
-[Color5]
-Color=155,89,182
-
-[Color5Faint]
-Color=97,74,115
-
-[Color5Intense]
-Color=142,68,173
-
-[Color6]
-Color=26,188,156
-
-[Color6Faint]
-Color=24,108,96
-
-[Color6Intense]
-Color=22,160,133
-
-[Color7]
-Color=252,252,252
-
-[Color7Faint]
-Color=99,104,109
-
-[Color7Intense]
-Color=255,255,255
-
-[Foreground]
-Color=252,252,252
-
-[ForegroundFaint]
-Color=239,240,241
-
-[ForegroundIntense]
-Color=61,174,233
-
-[General]
-Anchor=0.5,0.5
-Blur=false
-ColorRandomization=false
-Description=Custom
-FillStyle=Tile
-Opacity=0.9
-Wallpaper=
-WallpaperFlipType=NoFlip
-WallpaperOpacity=1
diff --git a/modules/packages/konsole/konsolestaterc b/modules/packages/konsole/konsolestaterc
deleted file mode 100644
index 8eac825..0000000
--- a/modules/packages/konsole/konsolestaterc
+++ /dev/null
@@ -1,4 +0,0 @@
-[MainWindow]
-1920x1080 screen: Height=640
-1920x1080 screen: Width=1138
-State=AAAA/wAAAAD9AAAAAQAAAAAAAAAAAAAAAPwCAAAAAvsAAAAiAFEAdQBpAGMAawBDAG8AbQBtAGEAbgBkAHMARABvAGMAawAAAAAA/////wAAAXIA////+wAAABwAUwBTAEgATQBhAG4AYQBnAGUAcgBEAG8AYwBrAAAAAAD/////AAABEQD///8AAARyAAACgAAAAAQAAAAEAAAACAAAAAj8AAAAAQAAAAIAAAACAAAAFgBtAGEAaQBuAFQAbwBvAGwAQgBhAHIAAAAAAP////8AAAAAAAAAAAAAABwAcwBlAHMAcwBpAG8AbgBUAG8AbwBsAGIAYQByAAAAAAD/////AAAAAAAAAAA=
diff --git a/modules/packages/nvim.nix b/modules/packages/nvim.nix
deleted file mode 100644
index 6c629fd..0000000
--- a/modules/packages/nvim.nix
+++ /dev/null
@@ -1,50 +0,0 @@
-{ pkgs, ... }:
-
-{
- environment.persistence."/nix/persist".users.hu.directories = [
- ".local/share/nvim"
- ".local/state/nvim"
- ];
-
- environment.variables = {
- EDITOR = "nvim";
- };
-
- home-manager.users.hu = {
- programs.neovim = {
- enable = true;
- defaultEditor = true;
- extraPackages = with pkgs; [
- lua-language-server
- nodePackages.intelephense
- nodePackages.typescript-language-server
- (llvmPackages_19.clang-tools.override {
- enableLibcxx = true;
- })
- ccls
- ripgrep
- nil
- gcc14
- basedpyright
- rust-analyzer
- zathura
- git
- texliveFull
- luajitPackages.jsregexp
- luajitPackages.luarocks
- fd
- texlab
- haskell-language-server
- rustc
- shellcheck
- bash-language-server
- ];
- };
-
- home.file."/home/hu/.config/nvim" = {
- source = ../../dotfiles/nvim;
- recursive = true;
- };
- };
-}
-
diff --git a/modules/packages/rofi.nix b/modules/packages/rofi.nix
deleted file mode 100644
index 3471aa6..0000000
--- a/modules/packages/rofi.nix
+++ /dev/null
@@ -1,11 +0,0 @@
-{ pkgs, ... }:
-
-{
- home-manager.users.hu = {
- programs.rofi = {
- enable = true;
- package = pkgs.rofi-wayland;
- theme = "sidebar";
- };
- };
-}
diff --git a/modules/packages/tmux.nix b/modules/packages/tmux.nix
deleted file mode 100644
index 960e832..0000000
--- a/modules/packages/tmux.nix
+++ /dev/null
@@ -1,43 +0,0 @@
-{ pkgs, ... }:
-
-{
- programs.tmux = {
- enable = true;
- customPaneNavigationAndResize = true;
- baseIndex = 1;
- plugins = with pkgs; [
- tmuxPlugins.resurrect
- ];
- extraConfig = ''
- # Enable mouse
- setw -g mouse on
-
- # Neovim
- set-option -sg escape-time 10
- set-option -g focus-events on
- # https://stackoverflow.com/questions/60309665/neovim-colorscheme-does-not-look-right-when-using-nvim-inside-tmux#comment124479399_60313682
- set-option -ga terminal-overrides ",xterm-256color:Tc"
-
- # vi mode
- set -g mode-keys vi
- set -g status-keys vi
-
- # Rebind prefix key to C-a
- set -g prefix C-a
- bind C-a send-prefix
- unbind C-b
-
- # Clipboard
- set -ga update-environment WAYLAND_DISPLAY
- bind Escape copy-mode
- bind p run-shell 'tmux set-buffer -- "$(wl-paste -t "text/plain;charset=utf-8")"; tmux paste-buffer'
- bind -T copy-mode-vi 'v' send -X begin-selection
- bind -T copy-mode-vi 'y' send -X copy-pipe 'wl-copy'
- set -s set-clipboard off
-
- # Status bar
- set -g status-style bg=default
- set -g status-fg 4
- '';
- };
-}
diff --git a/modules/packages/waybar.nix b/modules/packages/waybar.nix
deleted file mode 100644
index 5ef14b7..0000000
--- a/modules/packages/waybar.nix
+++ /dev/null
@@ -1,55 +0,0 @@
-{ ... }:
-
-{
- home-manager.users.hu = {
- programs.waybar = {
- enable = true;
- systemd = {
- enable = true;
- };
-
- settings = {
- bar = {
- layer = "top";
- position = "top";
- height = 32;
- output = [
- "DP-1"
- ];
-
- modules-left = [ "hyprland/workspaces" "hyprland/submap" ];
- modules-center = [ "hyprland/window" ];
- modules-right = [ "tray" "clock" ];
- };
- };
- style = ''
- * {
- all: unset;
- border-radius: 0;
- font-family: "Go Mono Nerd Font";
- font-size: 11pt;
- min-height: 0;
- }
-
- window#waybar {
- color: #c5c9c5;
- background: #181616;
- border-bottom: 2px solid rgba(53,132,228, 1);
- }
-
- #workspaces button {
- padding: 0 8pt 0 8pt;
- }
-
- #workspaces button.active {
- color: #3584e4;
- }
-
- #clock {
- padding: 0 8pt 0 8pt;
- }
- '';
- };
- };
-}
-
diff --git a/modules/packages/zsh.nix b/modules/packages/zsh.nix
deleted file mode 100644
index 8b7ed1c..0000000
--- a/modules/packages/zsh.nix
+++ /dev/null
@@ -1,43 +0,0 @@
-{ pkgs, ... }:
-
-{
- users.users.hu.shell = pkgs.zsh;
-
- environment.variables = {
- ZDOTDIR = "/home/hu/.config/zsh";
- };
-
- home-manager.users.hu = {
- home.packages = with pkgs; [
- fzf
- thefuck
- zsh-fzf-tab
- zsh-completions
- zsh-autosuggestions
- zsh-syntax-highlighting
- nix-zsh-completions
- zsh-nix-shell
- ];
-
- home.sessionVariables = {
- ZDOTDIR = "/home/hu/.config/zsh";
- };
-
- home.file."/home/hu/.config/zsh/conf.d" = {
- source = ../../dotfiles/zsh/conf.d;
- recursive = true;
- };
-
- home.file."/home/hu/.config/zsh/.zshrc" = {
- text = ''
- #!/usr/bin/env zsh
-
- SYNTAX_PLUGIN="${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
- AUTOSUGGEST_PLUGIN="${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
- NIX_SHELL_PLUGIN="${pkgs.zsh-nix-shell}/share/zsh-nix-shell/nix-shell.plugin.zsh"
- FZF_TAB_PLUGIN="${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh"
- '' + (builtins.readFile ../../dotfiles/zsh/.zshrc);
- };
- };
-}
-
diff --git a/modules/system/basic.nix b/modules/system/basic.nix
deleted file mode 100644
index 531ed0f..0000000
--- a/modules/system/basic.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-{ pkgs, ... }:
-
-{
- programs.zsh.enable = true;
-
- programs.nh = {
- enable = true;
- flake = "/nix/config";
- };
-
- environment.systemPackages = with pkgs; [
- fastfetch
- wget
- unzip
- git
- tree
- dos2unix
- neovim
- libqalculate
- ];
-}
diff --git a/modules/system/development.nix b/modules/system/development.nix
deleted file mode 100644
index a711c57..0000000
--- a/modules/system/development.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-{ pkgs, ... }:
-
-{
- imports = [
- ../packages/git.nix
- ../packages/nvim.nix
- ];
-
- environment.systemPackages = with pkgs; [
- wireshark
- seer
- mars-mips
- ];
-
- users.users.hu.extraGroups = [ "wireshark" ];
-}
-
diff --git a/modules/system/fonts.nix b/modules/system/fonts.nix
deleted file mode 100644
index 8ee1c4e..0000000
--- a/modules/system/fonts.nix
+++ /dev/null
@@ -1,8 +0,0 @@
-{ pkgs, ... }:
-
-{
- fonts.packages = with pkgs; [
- nerdfonts
- ];
-}
-
diff --git a/modules/system/security.nix b/modules/system/security.nix
deleted file mode 100644
index 11415de..0000000
--- a/modules/system/security.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-{ ... }:
-
-{
- security.sudo.extraConfig = ''
- Defaults lecture="never"
- '';
-
- security.apparmor = {
- enable = true;
- };
-
- nixpkgs.config.permittedInsecurePackages = [
- "jitsi-meet-1.0.8043"
- ];
-}
-
diff --git a/modules/system/virtualisation.nix b/modules/system/virtualisation.nix
deleted file mode 100644
index 891a978..0000000
--- a/modules/system/virtualisation.nix
+++ /dev/null
@@ -1,18 +0,0 @@
-{ ... }:
-
-{
- virtualisation.libvirtd.enable = true;
- programs.virt-manager.enable = true;
-
- users.users.hu.extraGroups = [ "libvirtd" ];
-
- home-manager.users.hu = {
- dconf.settings = {
- "org/virt-manager/virt-manager/connections" = {
- autoconnect = ["qemu:///system"];
- uris = ["qemu:///system"];
- };
- };
- };
-}
-
diff --git a/overlays/nixpak/default.nix b/overlays/nixpak/default.nix
new file mode 100644
index 0000000..be99ce8
--- /dev/null
+++ b/overlays/nixpak/default.nix
@@ -0,0 +1,8 @@
+{ inputs, lib, ... }: final: prev: {
+ mkNixPak = let
+ pkgs = prev;
+ in inputs.nixpak.lib.nixpak {
+ inherit (pkgs) lib;
+ inherit pkgs;
+ };
+}
diff --git a/overlays/nixpak/firefox.nix b/overlays/nixpak/firefox.nix
new file mode 100644
index 0000000..3d1a08b
--- /dev/null
+++ b/overlays/nixpak/firefox.nix
@@ -0,0 +1,91 @@
+# Shamelessly stolen most parts from here:
+# https://github.com/ryan4yin/nix-config/blob/7deed26cc5a3af2072b8c89a688f265607babc80/hardening/nixpaks/firefox.nix
+# https://github.com/schizofox/schizofox/blob/cdf69b2a445ff12680657a3bd44ce7c406bf2ae6/flake/modules/home-manager/default.nix
+
+# NOTE: This overlay package is not compatible with the `programs.firefox` module
+# for both NixOS and home-manager. If you want to modify the configuration of
+# Firefox, you have to do it through modifying the overrides for the intermediary
+# package below. This configuration already sets sane defaults so it shouldn't be needed
+# but it is there in case you want it.
+
+{ cfgPath, ... }: final: prev: {
+ firefox-esr = let
+ intermediary-firefox-esr = let
+ policiesFile = "${cfgPath}/modules/nixos/multimedia/web/firefox/policies.nix";
+ prefsFile = "${cfgPath}/modules/nixos/multimedia/web/firefox/preferences.nix";
+ in prev.firefox-esr.override {
+ extraPolicies = import policiesFile;
+ extraPrefs = import prefsFile;
+ };
+
+ sandboxed-firefox-esr = prev.mkNixPak {
+ config = { sloth, ... }: {
+ app.package = intermediary-firefox-esr;
+ app.binPath = "bin/firefox-esr";
+ flatpak.appId = "org.mozilla.firefox";
+
+ dbus.policies = {
+ "org.a11y.Bus" = "talk";
+ "org.gnome.SessionManager" = "talk";
+ "org.freedesktop.ScreenSaver" = "talk";
+ "org.gtk.vfs.*" = "talk";
+ "org.gtk.vfs" = "talk";
+ "org.freedesktop.Notifications" = "talk";
+ "org.freedesktop.portal.FileChooser" = "talk";
+ "org.freedesktop.portal.Settings" = "talk";
+ "org.mpris.MediaPlayer2.firefox.*" = "own";
+ "org.mozilla.firefox.*" = "own";
+ "org.mozilla.firefox_beta.*" = "own";
+ "org.freedesktop.DBus" = "talk";
+ "org.freedesktop.DBus.*" = "talk";
+ "ca.desrt.dconf" = "talk";
+ "org.freedesktop.portal.*" = "talk";
+ "org.freedesktop.NetworkManager" = "talk";
+ "org.freedesktop.FileManager1" = "talk";
+ };
+
+ gpu.enable = true;
+ gpu.provider = "bundle";
+ fonts.enable = true;
+ locale.enable = true;
+ etc.sslCertificates.enable = true;
+
+ bubblewrap = let
+ envSuffix = envKey: sloth.concat' (sloth.env envKey);
+ in {
+ bind.dev = [ "/dev/shm" ];
+ tmpfs = [ "/tmp" ];
+
+ bind.rw = [
+ (envSuffix "XDG_RUNTIME_DIR" "/at-spi/bus")
+ (envSuffix "XDG_RUNTIME_DIR" "/gvfsd")
+ (envSuffix "XDG_RUNTIME_DIR" "/pulse")
+ (envSuffix "XDG_RUNTIME_DIR" "/doc")
+ (envSuffix "XDG_RUNTIME_DIR" "/dconf")
+
+ [(sloth.mkdir (sloth.concat' sloth.xdgConfigHome "/mozilla")) (sloth.concat' sloth.homeDir "/.mozilla")]
+ ];
+
+ bind.ro = [
+ "/sys/bus/pci"
+ "/etc/resolv.conf"
+ "/etc/localtime"
+ ["${intermediary-firefox-esr}/lib/firefox" "/app/etc/firefox"]
+ (sloth.concat' sloth.xdgConfigHome "/dconf")
+ (sloth.concat' sloth.xdgConfigHome "/gtk-2.0")
+ (sloth.concat' sloth.xdgConfigHome "/gtk-3.0")
+ (sloth.concat' sloth.xdgConfigHome "/gtk-4.0")
+ (sloth.concat' sloth.xdgConfigHome "/dconf")
+ ];
+
+ sockets = {
+ x11 = false;
+ wayland = true;
+ pipewire = true;
+ };
+ };
+ };
+ };
+ in
+ sandboxed-firefox-esr.config.env;
+}
diff --git a/overlays/nixpak/tor-browser.nix b/overlays/nixpak/tor-browser.nix
new file mode 100644
index 0000000..814a967
--- /dev/null
+++ b/overlays/nixpak/tor-browser.nix
@@ -0,0 +1,56 @@
+# Refer to firefox.nix in the same directory for more information and a
+# better version of this. This is barebones on purpose.
+
+# TODO: Fix file permissions. Right now it for some reason can't download anywhere.
+
+{ ... }: final: prev: {
+ tor-browser = let
+ sandboxed-tor-browser = prev.mkNixPak {
+ config = { sloth, ... }: {
+ app.package = prev.tor-browser;
+ app.binPath = "bin/tor-browser";
+ flatpak.appId = "org.torproject.tor-browser";
+
+ dbus.policies = {
+ "org.a11y.Bus" = "talk";
+ "org.gnome.SessionManager" = "talk";
+ "org.freedesktop.ScreenSaver" = "talk";
+ "org.gtk.vfs.*" = "talk";
+ "org.gtk.vfs" = "talk";
+ "org.freedesktop.Notifications" = "talk";
+ "org.freedesktop.portal.FileChooser" = "talk";
+ "org.freedesktop.portal.Settings" = "talk";
+ "org.torproject.tor-browser.*" = "own";
+ "org.freedesktop.DBus" = "talk";
+ "org.freedesktop.DBus.*" = "talk";
+ "org.freedesktop.portal.*" = "talk";
+ "org.freedesktop.NetworkManager" = "talk";
+ "org.freedesktop.FileManager1" = "talk";
+ };
+
+ gpu.enable = true;
+ gpu.provider = "bundle";
+
+ bubblewrap = {
+ bind.dev = [ "/dev/shm" ];
+
+ bind.rw = [
+ [(sloth.mkdir "/tmp/tor-browser") (sloth.concat' sloth.homeDir "/.tor project")]
+ ];
+
+ bind.ro = [
+ "/sys/bus/pci"
+ ["${prev.tor-browser}/lib/firefox" "/app/etc/firefox"]
+ ];
+
+ sockets = {
+ x11 = false;
+ wayland = true;
+ pipewire = true;
+ };
+ };
+ };
+ };
+ in
+ sandboxed-tor-browser.config.env;
+}
diff --git a/overlays/nixpkgs/unstable.nix b/overlays/nixpkgs/unstable.nix
new file mode 100644
index 0000000..7450370
--- /dev/null
+++ b/overlays/nixpkgs/unstable.nix
@@ -0,0 +1,5 @@
+{ inputs, ... }: final: prev: {
+ unstable = import inputs.nixpkgs-unstable {
+ inherit (prev) system config overlays;
+ };
+}
diff --git a/overlays/steam.nix b/overlays/steam.nix
new file mode 100644
index 0000000..6c8e345
--- /dev/null
+++ b/overlays/steam.nix
@@ -0,0 +1,12 @@
+{ ... }: final: prev: {
+ steam = prev.steam.override {
+ extraBwrapArgs = [
+ "--bind $HOME/.local/share/steam_home $HOME"
+ "--unsetenv XDG_CACHE_HOME"
+ "--unsetenv XDG_CONFIG_HOME"
+ "--unsetenv XDG_DATA_HOME"
+ "--unsetenv XDG_STATE_HOME"
+ ];
+ };
+}
+