mirror of
https://codeberg.org/leana8959/.files.git
synced 2026-02-01 14:29:40 +00:00
Compare commits
178 commits
209896025f
...
a320cba909
| Author | SHA1 | Date | |
|---|---|---|---|
| a320cba909 | |||
| 9627e74f1d | |||
| 6783ce6f72 | |||
| eb750b585d | |||
| 99b1dda7ba | |||
| 1e63c7bb53 | |||
| 18418415d1 | |||
| 076a4448e7 | |||
| b66c63601f | |||
| 9fd52db5bb | |||
| 5a39fe89c5 | |||
| c2a37b5f72 | |||
| 72ae42c1a0 | |||
| f73281da80 | |||
| 2a3142634e | |||
| 23f3fb783c | |||
| 536fa705b7 | |||
| ee55696b3a | |||
| d74a807122 | |||
| 88af6454b7 | |||
| 42b32be4a5 | |||
| 54f685e90c | |||
| 70e063d8df | |||
| b02ab4df08 | |||
| 90def3c705 | |||
| 7f233194e2 | |||
| a4c43068f4 | |||
| 018a8b66c7 | |||
| b293776da0 | |||
| 434ce5437c | |||
| 4adfe435df | |||
| fdc88e415f | |||
| c6d39532a6 | |||
| c96b65bea7 | |||
| 9174bda378 | |||
| fd60c6c726 | |||
| b50954a4ef | |||
| b7b2083c74 | |||
| 44576984e5 | |||
| a89146bc5b | |||
| d252914f55 | |||
| 0387c3fcb0 | |||
| 1ede0b2961 | |||
| c7cb48a6ec | |||
| 02f4b51d10 | |||
| 1bec3a93a0 | |||
| 4c4ed165b3 | |||
| bc2a414ef5 | |||
| 765fe566fc | |||
| 8f0bc83348 | |||
| a72b91e25b | |||
| fe7f4b9049 | |||
| b3c6744da5 | |||
| a57af732e9 | |||
| cc13b4d51e | |||
| c72ef76b20 | |||
| 412480f14c | |||
| 20bd1bc6fe | |||
| 9d6cc4b934 | |||
| caadc265e4 | |||
| 9b02b9e1da | |||
| 5bad4db389 | |||
| 05e980d72a | |||
| 2cada3b44e | |||
| c2c655981a | |||
| 7549b79730 | |||
| d74245aff7 | |||
| b0813c1e96 | |||
| 530977a139 | |||
| 8e7cfef3f2 | |||
| 70e7b70875 | |||
| f2ab0ac3a3 | |||
| 36af139254 | |||
| 8e6ce9e5df | |||
| 4bb8909218 | |||
| ae721808c0 | |||
| 6bebe18fcb | |||
| 2840500790 | |||
| 7decf821d7 | |||
| 812d50160e | |||
| 8f89b732d5 | |||
| b8f78260b3 | |||
| 60bfd4f5c9 | |||
| d3489e5730 | |||
| 112439418c | |||
| 58e39ea0a6 | |||
| e7c50da45f | |||
| 3e603eb1e0 | |||
| 33aa3065c3 | |||
| 9b1399e0e6 | |||
| 587b4a4e20 | |||
| 09d5f8e0c8 | |||
| 9f080c0707 | |||
| 9b52493e5f | |||
| 51352a91d0 | |||
| 06c9fe9f1e | |||
| 1409a5e064 | |||
| a27f5ffefe | |||
| c8dee130a6 | |||
| 5f1cea7f25 | |||
| 0d468192be | |||
| 89e9803ed7 | |||
| 34619bec86 | |||
| 77dc32f91c | |||
| cf2cf553e0 | |||
| 90e1880e75 | |||
| 83081607ea | |||
| c7e5e65062 | |||
| 2c2af2aea2 | |||
| 6f9f2ba7f0 | |||
| 2f1d8e61f8 | |||
| 89ae4c2ad7 | |||
| 29c4ca1a81 | |||
| eac1c86fe8 | |||
| 156181fc14 | |||
| efdba54fc4 | |||
| eb9e567865 | |||
| fb1f6624f9 | |||
| 5fa1113757 | |||
| a9701f83b3 | |||
| 9e79cd2347 | |||
| fe52691061 | |||
| ebf8468807 | |||
| ec704b5272 | |||
| e218086537 | |||
| 57e19055c4 | |||
| 6f530c8e35 | |||
| 2922707f17 | |||
| d243e6c32f | |||
| 073078a922 | |||
| b123f1650d | |||
| 3a3e38dfa4 | |||
| 4874f1f39b | |||
| 5ee9d8b245 | |||
| 70a9c78bfc | |||
| 29a779cfe1 | |||
| 4d4363ced1 | |||
| d22bd9ae28 | |||
| 45e0882b0c | |||
| 3084711044 | |||
| 46ef4a3312 | |||
| 089a055d29 | |||
| 62a710c542 | |||
| 50db96001e | |||
| 432efd430c | |||
| 5447573e69 | |||
| 9242a3dfb5 | |||
| 2ec26ff49e | |||
| cb1310015e | |||
| 06426aa62d | |||
| 0cdd300498 | |||
| 82baec0470 | |||
| 006798d917 | |||
| a1024668db | |||
| 16a1666570 | |||
| 726a416e32 | |||
| a135fecd68 | |||
| 7a613e9a43 | |||
| 3eb030b8f4 | |||
| 12ccc6c619 | |||
| adf81cc4bd | |||
| fe642eba09 | |||
| 3e7a697db0 | |||
| 4669dd485d | |||
| d96871819c | |||
| 7d1292945f | |||
| 8d004fd48f | |||
| d9940eb52e | |||
| ffb056837c | |||
| 1af4390d05 | |||
| 9cace50bb1 | |||
| 0c1f72b6e2 | |||
| e1407ff24e | |||
| fb527f7dce | |||
| 8f8b6e35ba | |||
| 481814881b | |||
| 38a79e2fd8 | |||
| da0bb14a96 |
191 changed files with 4592 additions and 2337 deletions
|
|
@ -5,4 +5,4 @@ vim.bo.shiftwidth = 2
|
|||
vim.bo.expandtab = true
|
||||
|
||||
-- useful for CPP extension
|
||||
vim.o.smartindent = true
|
||||
vim.bo.smartindent = true
|
||||
|
|
|
|||
|
|
@ -7,4 +7,4 @@ require("_lazy")
|
|||
require("lsp.haskell")
|
||||
require("lsp.rust")
|
||||
|
||||
vim.cmd.colorscheme("curry")
|
||||
vim.cmd.colorscheme("milou")
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
||||
"cmp-spell": { "branch": "master", "commit": "694a4e50809d6d645c1ea29015dad0c293f019d6" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"curry.nvim": { "branch": "mistress", "commit": "2c20e5dd43af134a6e18e21ba53f1c0830abe4fc" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "3f5475949679953af6d78654db29b944fa826e6a" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "1ee5c1fd068c81f9dd06483e639c2aa4587dc197" },
|
||||
|
|
@ -16,6 +15,7 @@
|
|||
"lazy.nvim": { "branch": "main", "commit": "59334064f8604ca073791c25dcc5c9698865406e" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "258d2a5ef4a3e3d6d9ba9da72c9725c53e9afcbd" },
|
||||
"leap.nvim": { "branch": "main", "commit": "07304103f6bd923004fdef9262d9a4d7925fb70a" },
|
||||
"milou": { "branch": "haddock", "commit": "ae95eb2ebdbc4228931ceefa64f86b877213dc62" },
|
||||
"no-neck-pain.nvim": { "branch": "main", "commit": "ecc584150f5c8a2a82f2e1d43201df0f65c63d0e" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
||||
|
|
@ -38,5 +38,6 @@
|
|||
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" },
|
||||
"vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
|
||||
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }
|
||||
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
|
||||
"vimtex": { "branch": "master", "commit": "2e1bbabeb2c34bb17d7bc8cfdf8f95b16dd0db0c" }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,8 @@ local plugins = {
|
|||
-- Highlight comments
|
||||
{ "folke/todo-comments.nvim", dependencies = "nvim-lua/plenary.nvim" },
|
||||
|
||||
"leana8959/curry.nvim",
|
||||
-- "leana8959/curry.nvim",
|
||||
"https://git.confusedcompiler.org/leana8959/milou",
|
||||
|
||||
--
|
||||
-- LSP / DAP
|
||||
|
|
@ -113,6 +114,12 @@ local plugins = {
|
|||
},
|
||||
-- The haskell lexer
|
||||
"vim-scripts/alex.vim",
|
||||
{
|
||||
-- https://github.com/lervag/vimtex#lazynvim
|
||||
"lervag/vimtex",
|
||||
lazy = false,
|
||||
version = "^2",
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
branch = "0.1.x",
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ local servers = {
|
|||
tinymist = {},
|
||||
nil_ls = {
|
||||
settings = {
|
||||
["nil"] = { formatting = { command = { "alejandra" } } },
|
||||
["nil"] = { formatting = { command = { "nixfmt" } } },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ local cr = function() return t { "", "" } end
|
|||
local i = luasnip.insert_node
|
||||
local f = luasnip.function_node
|
||||
|
||||
local function datetime() return os.date('%Y-%m-%d %H:%M:%S') end
|
||||
local function date() return os.date('%Y-%m-%d') end
|
||||
local function datetime() return os.date("%Y-%m-%d %H:%M:%S") end
|
||||
local function date() return os.date("%Y-%m-%d") end
|
||||
local function quoted(s) return '"' .. s .. '"' end
|
||||
|
||||
luasnip.add_snippets("typst", {
|
||||
|
|
@ -57,5 +57,9 @@ luasnip.add_snippets("ruler", {
|
|||
}),
|
||||
})
|
||||
|
||||
luasnip.add_snippets("nix", {
|
||||
s("system", { t("stdenv.hostPlatform.system") }),
|
||||
})
|
||||
|
||||
local haskell_snippets = require("haskell-snippets").all
|
||||
luasnip.add_snippets("haskell", haskell_snippets, { key = "haskell" })
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ syn match rulerLineComment "--.*$"
|
|||
syn match rulerTripleDot "\.\.\."
|
||||
syn match rulerDate "\d\d\d\d\D\d\d\D\d\d \d\d\D\d\d\D\(\d\d\|__\)"
|
||||
syn match rulerTag "\s\+[a-zA-Z]\+:[^\n]*"
|
||||
syn match rulerImport "import"
|
||||
syn match rulerType "type"
|
||||
|
||||
syn region rulerBlockComment start="{-" end="-}"
|
||||
|
||||
|
|
@ -17,6 +19,8 @@ hi def link rulerLineComment Comment
|
|||
hi def link rulerBlockComment Comment
|
||||
hi def link rulerTripleDot Comment
|
||||
hi def link rulerDate Macro
|
||||
hi def link rulerImport Keyword
|
||||
hi def link rulerType Keyword
|
||||
hi def link rulerTag @property
|
||||
|
||||
let b:current_syntax = "ruler"
|
||||
|
|
|
|||
|
|
@ -7,3 +7,6 @@ e91471432f7b7e3e5cb6cdb245819998d6653b5e
|
|||
|
||||
# Reformat with stylua
|
||||
94ab5d51f10e609cee0159636c29cd404e3a6570
|
||||
|
||||
# Reformat with nixfmt
|
||||
ebf84688079b537b3a34a7f5decdf30e165b7933
|
||||
|
|
|
|||
15
Justfile
15
Justfile
|
|
@ -6,10 +6,10 @@ os host action:
|
|||
set -euo pipefail
|
||||
|
||||
nixpkgs=$(nix-instantiate --eval -E "let sources = import ./npins; in sources.nixpkgs.outPath" | jq -r .)
|
||||
sudo nixos-rebuild {{ action }} \
|
||||
nixos-rebuild {{ action }} \
|
||||
-I nixpkgs=${nixpkgs} \
|
||||
-I nixos-config=./nix/configurations/{{ host }}.nix \
|
||||
--fast \
|
||||
--no-reexec \
|
||||
--file ./default.nix \
|
||||
--attr "nixosConfigurations.{{ host }}"
|
||||
|
||||
|
|
@ -18,15 +18,18 @@ install host:
|
|||
set -euo pipefail
|
||||
|
||||
nixpkgs=$(nix-instantiate --eval -E "let sources = import ./npins; in sources.nixpkgs.outPath" | jq -r .)
|
||||
sudo nixos-install \
|
||||
nixos-install \
|
||||
-I nixpkgs=${nixpkgs} \
|
||||
-I nixos-config=./nix/configurations/{{ host }}.nix \
|
||||
--file ./default.nix \
|
||||
--attr "nixosConfigurations.{{ host }}"
|
||||
|
||||
cleanup:
|
||||
sudo nix-env --delete-generations +10 -p /nix/var/nix/profiles/system
|
||||
nix-env --delete-generations +10 -p ~/.local/state/nix/profiles/home-manager
|
||||
# Retain four weeks of generations so I don't fuck up
|
||||
clean-os:
|
||||
nix-env --delete-generations 28d -p /nix/var/nix/profiles/system
|
||||
|
||||
clean-hm:
|
||||
nix-env --delete-generations 28d -p ~/.local/state/nix/profiles/home-manager
|
||||
|
||||
update:
|
||||
npins update
|
||||
|
|
|
|||
49
README.md
49
README.md
|
|
@ -4,6 +4,7 @@ This repo is managed with Nix + GNU stow
|
|||
- Generate image & boot
|
||||
We do this because the default one doesn't have all the utilities we want (e.g. disko).
|
||||
- generate image `nom-build --attr nixosConfigurations.installer.config.system.build.isoImage`
|
||||
- wipe the disk's fs with `wipefs`
|
||||
- `dd` the image to a flash drive (remember to `sync`)
|
||||
- boot off that flash drive
|
||||
|
||||
|
|
@ -29,13 +30,57 @@ This repo is managed with Nix + GNU stow
|
|||
disko -m disko ./disko.nix # format the drive
|
||||
|
||||
# optional for unknown hard ware
|
||||
nixos-generate-config --no-filesystems --root /mnt --dir . # disko will take care of the file system configuration
|
||||
nixos-generate-config --no-filesystems --dir . # disko will take care of the file system configuration
|
||||
# put the generated config in the right path and import it
|
||||
|
||||
nixos-install --flake .dotfiles#<hostname>
|
||||
# We do -j 1 because otherwise the kernel or the fonts might use too much
|
||||
# memory at the same time and the system will kaput
|
||||
nixos-install --flake .dotfiles#<hostname> -j 1
|
||||
|
||||
# profit
|
||||
```
|
||||
|
||||
## Installation for Raspberry Pi
|
||||
Raspberry Pi uses the same configuration as the installer.
|
||||
The `(modulesPath + "/installer/sd-card/sd-image-aarch64.nix")` allows this.
|
||||
|
||||
- Build the image `nixosConfigurations.<name>.config.system.build.sdImage`.
|
||||
Disable stuff like Lix to build this.
|
||||
You might want to use raw password once so you don't have agenix decryption
|
||||
problem while trying to have wpa_supplicant have the right passwords.
|
||||
|
||||
- Burn the image to the sd card.
|
||||
```bash
|
||||
zstdcat result/sd-image/nixos-image-sd-card-<hash>-aarch64-linux.img.zst |
|
||||
doas dd of=/dev/sdb status=progress
|
||||
```
|
||||
|
||||
- profit
|
||||
|
||||
## Hetzner, nixos-anywhere
|
||||
References:
|
||||
- <https://github.com/nix-community/nixos-anywhere/blob/main/docs/quickstart.md>
|
||||
- <https://wiki.nixos.org/wiki/Install_NixOS_on_Hetzner_Cloud>
|
||||
|
||||
I haven't figured out how to use raid on this machine, as it failed half-way
|
||||
through the installer when I used the raid configuration.
|
||||
|
||||
### Pitfalls
|
||||
- nixos-anywhere will wipe the disk, even if you use the flag `--generate-hardware-config`.
|
||||
|
||||
- The command is quite long and isn't non-flake friendly.
|
||||
Note that the diskoScript has to come before toplevel derivation.
|
||||
Read more on the order <https://github.com/nix-community/nixos-anywhere/issues/597>.
|
||||
```fish
|
||||
nixos-anywhere \
|
||||
--generate-hardware-config nixos-generate-config ./hardware-configuration.nix \
|
||||
-i <ssh_identity> \
|
||||
--store-paths $(nix-build --no-out-link \
|
||||
-A nixosConfigurations.hetzner_benchmark.config.system.build.diskoScript \
|
||||
-A nixosConfigurations.hetzner_benchmark.config.system.build.toplevel) \
|
||||
<user>@<host>
|
||||
```
|
||||
|
||||
# Pitfalls
|
||||
## `users.mutableUsers`
|
||||
NEVER set this to true without declaratively setting the passwords.
|
||||
|
|
|
|||
54
default.nix
54
default.nix
|
|
@ -1,18 +1,48 @@
|
|||
{sources ? import ./npins}: {
|
||||
{
|
||||
sources ? import ./npins,
|
||||
}:
|
||||
{
|
||||
# for repl sessions
|
||||
inherit sources;
|
||||
lib = import (sources.nixpkgs + "/lib");
|
||||
|
||||
nixosConfigurations = builtins.mapAttrs (_: import (sources.nixpkgs + "/nixos/lib/eval-config.nix")) {
|
||||
vanadium = {
|
||||
system = "x86_64-linux";
|
||||
modules = [./nix/configurations/vanadium.nix];
|
||||
};
|
||||
installer = {
|
||||
system = "x86_64-linux";
|
||||
modules = [./nix/configurations/installer.nix];
|
||||
};
|
||||
};
|
||||
nixosConfigurations =
|
||||
builtins.mapAttrs (_: import (sources.nixpkgs + "/nixos/lib/eval-config.nix"))
|
||||
{
|
||||
vanadium = {
|
||||
system = "x86_64-linux";
|
||||
modules = [ ./nix/configurations/vanadium.nix ];
|
||||
};
|
||||
hydrogen = {
|
||||
system = "aarch64-linux";
|
||||
modules = [ ./nix/configurations/hydrogen.nix ];
|
||||
};
|
||||
iron = {
|
||||
system = "x86_64-linux";
|
||||
modules = [ ./nix/configurations/iron.nix ];
|
||||
};
|
||||
installer = {
|
||||
system = "x86_64-linux";
|
||||
modules = [ ./nix/configurations/installer.nix ];
|
||||
};
|
||||
# Specialized with patches for the GPU
|
||||
installer-macbook-pro-2009 = {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
./nix/configurations/installer.nix
|
||||
./nix/nixosModules/extra/macbook-pro-radeon.nix
|
||||
./nix/nixosModules/extra/macbook-swap-cmd-opt.nix
|
||||
./nix/nixosModules/extra/macbook-swap-fn-ctrl.nix
|
||||
./nix/nixosModules/extra/macbook-broacom-b43.nix
|
||||
];
|
||||
};
|
||||
|
||||
packages = import ./nix/packages {inherit sources;};
|
||||
# Not mine, rented on hetzner
|
||||
hetzner_benchmark = {
|
||||
system = "x86_64-linux";
|
||||
modules = [ ./nix/configurations/hetzner_benchmark.nix ];
|
||||
};
|
||||
};
|
||||
|
||||
packages = import ./nix/packages { inherit sources; };
|
||||
}
|
||||
|
|
|
|||
118
nix/configurations/hetzner_benchmark.nix
Normal file
118
nix/configurations/hetzner_benchmark.nix
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
# The hetzner machine rented to benchmark the cabal comment parser
|
||||
let
|
||||
sources = import ../../npins;
|
||||
|
||||
hostname = "hetzner_benchmark";
|
||||
username = "leana";
|
||||
in
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib.modules) mkAliasOptionModule;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
#
|
||||
# Shorthands
|
||||
#
|
||||
(mkAliasOptionModule [ "me" ] [ "users" "users" username ])
|
||||
(mkAliasOptionModule [ "hm" ] [ "home-manager" "users" username ])
|
||||
|
||||
#
|
||||
# hostname
|
||||
#
|
||||
{ _module.args = { inherit hostname; }; }
|
||||
|
||||
#
|
||||
# nixpkgs
|
||||
#
|
||||
{
|
||||
# don't use `nixpkgs.flake.source`, it uses flake so it double fetches
|
||||
nix.nixPath = [ "nixpkgs=${sources.nixpkgs}" ];
|
||||
|
||||
nixpkgs = {
|
||||
overlays = map import [
|
||||
../packages/overlay.nix
|
||||
|
||||
# use lix everywhere and wrap it with nom
|
||||
../overlays/lix.nix
|
||||
../overlays/nix-monitored.nix
|
||||
];
|
||||
};
|
||||
|
||||
nix.package = pkgs.nix-monitored;
|
||||
|
||||
system.nixos =
|
||||
let
|
||||
rev = lib.substring 0 8 sources.nixpkgs.revision;
|
||||
in
|
||||
{
|
||||
versionSuffix = "-git:${rev}";
|
||||
revision = rev;
|
||||
};
|
||||
}
|
||||
|
||||
./hetzner_benchmark/nixos/hardware-configuration.nix
|
||||
./hetzner_benchmark/nixos/misc.nix
|
||||
./hetzner_benchmark/nixos/programs.nix
|
||||
|
||||
../nixosModules/common/fish.nix
|
||||
../nixosModules/common/disable-command-not-found.nix
|
||||
../nixosModules/common/network.nix
|
||||
../nixosModules/common/sudo-conf.nix
|
||||
../nixosModules/common/system-nixconf.nix
|
||||
|
||||
../nixosModules/extra/leana.nix
|
||||
|
||||
#
|
||||
# Extern modules
|
||||
#
|
||||
(sources.disko + "/module.nix")
|
||||
../disko/hetzner_benchmark/ext4.nix
|
||||
|
||||
#
|
||||
# home-manager
|
||||
#
|
||||
(sources.home-manager + "/nixos")
|
||||
{
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
sharedModules = [ { home.stateVersion = lib.mkDefault config.system.stateVersion; } ];
|
||||
};
|
||||
|
||||
hm.imports = [
|
||||
#
|
||||
# hostname
|
||||
#
|
||||
{ _module.args = { inherit hostname; }; }
|
||||
|
||||
#
|
||||
# home modules
|
||||
#
|
||||
./hetzner_benchmark/home/programs.nix
|
||||
./hetzner_benchmark/home/dev.nix
|
||||
|
||||
../homeModules/common/btop
|
||||
../homeModules/common/fish
|
||||
../homeModules/common/starship
|
||||
../homeModules/common/fzf.nix
|
||||
../homeModules/common/tmux
|
||||
../homeModules/common/vim
|
||||
../homeModules/common/direnv.nix
|
||||
../homeModules/common/git.nix
|
||||
../homeModules/common/gpg.nix
|
||||
../homeModules/common/leana.nix
|
||||
../homeModules/common/locale.nix
|
||||
../homeModules/common/packages.nix
|
||||
../homeModules/common/tealdeer.nix
|
||||
|
||||
../homeModules/extra/tmux-fish-integration.nix
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
23
nix/configurations/hetzner_benchmark/home/dev.nix
Normal file
23
nix/configurations/hetzner_benchmark/home/dev.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
programs.git = {
|
||||
enable = true;
|
||||
signing.signByDefault = false; # no need to setup the key
|
||||
};
|
||||
|
||||
programs.gpg.enable = true;
|
||||
|
||||
nix = {
|
||||
settings = {
|
||||
extra-substituters = [
|
||||
"https://ghc-nix.cachix.org"
|
||||
"https://haskell-language-server.cachix.org"
|
||||
"https://cache.iog.io"
|
||||
];
|
||||
extra-trusted-public-keys = [
|
||||
"ghc-nix.cachix.org-1:ziC/I4BPqeA4VbtOFpFpu6D1t6ymFvRWke/lc2+qjcg="
|
||||
"haskell-language-server.cachix.org-1:juFfHrwkOxqIOZShtC4YC1uT1bBcq2RSvC7OMKx0Nz8="
|
||||
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
54
nix/configurations/hetzner_benchmark/home/programs.nix
Normal file
54
nix/configurations/hetzner_benchmark/home/programs.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
# TODO: remove some packages for this machine
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
home.sessionVariables =
|
||||
let
|
||||
fishCfg = config.programs.fish;
|
||||
in
|
||||
{
|
||||
"SHELL" = lib.mkIf fishCfg.enable (lib.getExe fishCfg.package);
|
||||
};
|
||||
|
||||
home.packages = [
|
||||
pkgs.stow
|
||||
pkgs.zip
|
||||
pkgs.unzip
|
||||
pkgs.gnutar
|
||||
pkgs.p7zip
|
||||
pkgs.bc
|
||||
pkgs.dig
|
||||
pkgs.hutils
|
||||
|
||||
# pretty tui tools
|
||||
pkgs.dust
|
||||
pkgs.tokei
|
||||
pkgs.hyperfine
|
||||
pkgs.watchexec
|
||||
pkgs.onefetch
|
||||
pkgs.just
|
||||
];
|
||||
|
||||
programs = {
|
||||
neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
};
|
||||
lazygit.enable = true;
|
||||
fish.enable = true;
|
||||
starship.enable = true;
|
||||
tmux.enable = true;
|
||||
direnv.enable = true;
|
||||
ripgrep.enable = true;
|
||||
|
||||
btop.enable = true;
|
||||
};
|
||||
|
||||
services = {
|
||||
gpg-agent.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"nvme"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp41s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
13
nix/configurations/hetzner_benchmark/nixos/misc.nix
Normal file
13
nix/configurations/hetzner_benchmark/nixos/misc.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
boot.loader.grub.enable = true;
|
||||
|
||||
services.openssh.enable = true;
|
||||
|
||||
users.users = {
|
||||
"root".openssh.authorizedKeys.keys = import ../../../identities.nix ++ [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFza3UN1gWQqh//FkJBzmssQ4lxHdllQGfqPHzG4LQI8 benchmark-machine"
|
||||
];
|
||||
};
|
||||
|
||||
system.stateVersion = "25.05";
|
||||
}
|
||||
4
nix/configurations/hetzner_benchmark/nixos/programs.nix
Normal file
4
nix/configurations/hetzner_benchmark/nixos/programs.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
# Helps with kitty when ssh from remote
|
||||
environment.enableAllTerminfo = true;
|
||||
}
|
||||
143
nix/configurations/hydrogen.nix
Normal file
143
nix/configurations/hydrogen.nix
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
let
|
||||
sources = import ../../npins;
|
||||
|
||||
hostname = "hydrogen";
|
||||
username = "leana";
|
||||
in
|
||||
{
|
||||
modulesPath,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib.modules) mkAliasOptionModule;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
# The generator and hardware configuration
|
||||
(modulesPath + "/installer/sd-card/sd-image-aarch64.nix")
|
||||
|
||||
#
|
||||
# Shorthands
|
||||
#
|
||||
(mkAliasOptionModule [ "me" ] [ "users" "users" username ])
|
||||
(mkAliasOptionModule [ "hm" ] [ "home-manager" "users" username ])
|
||||
|
||||
#
|
||||
# hostname
|
||||
#
|
||||
{ _module.args = { inherit hostname; }; }
|
||||
|
||||
#
|
||||
# nixpkgs
|
||||
#
|
||||
{
|
||||
# don't use `nixpkgs.flake.source`, it uses flake so it double fetches
|
||||
nix.nixPath = [ "nixpkgs=${sources.nixpkgs}" ];
|
||||
|
||||
nixpkgs = {
|
||||
overlays = map import [
|
||||
../overlays/agenix.nix
|
||||
../overlays/nur.nix
|
||||
../overlays/nix-tree.nix
|
||||
../packages/overlay.nix
|
||||
|
||||
# use lix everywhere and wrap it with nom
|
||||
../overlays/lix.nix
|
||||
../overlays/nix-monitored.nix
|
||||
];
|
||||
};
|
||||
|
||||
nix.package = pkgs.nix-monitored;
|
||||
|
||||
system.nixos =
|
||||
let
|
||||
rev = lib.substring 0 8 sources.nixpkgs.revision;
|
||||
in
|
||||
{
|
||||
versionSuffix = "-git:${rev}";
|
||||
revision = rev;
|
||||
};
|
||||
}
|
||||
|
||||
./hydrogen/nixos/misc.nix
|
||||
./hydrogen/nixos/programs.nix
|
||||
./hydrogen/nixos/connectivity.nix
|
||||
|
||||
../nixosModules/common/fish.nix
|
||||
../nixosModules/common/disable-command-not-found.nix
|
||||
../nixosModules/common/network.nix
|
||||
../nixosModules/common/sudo-conf.nix
|
||||
../nixosModules/common/system-nixconf.nix
|
||||
|
||||
# QUIRK:
|
||||
# Had issue when building the installer as it fails to bootstrap itself
|
||||
# Might be useful to disable for the first build.
|
||||
# ../nixosModules/extra/secure_dns.nix
|
||||
../nixosModules/extra/leana.nix
|
||||
|
||||
#
|
||||
# Extern modules
|
||||
#
|
||||
(sources.agenix + "/modules/age.nix")
|
||||
|
||||
(sources.nixos-hardware + "/raspberry-pi/4")
|
||||
|
||||
#
|
||||
# home-manager
|
||||
#
|
||||
(sources.home-manager + "/nixos")
|
||||
{
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
sharedModules = [ { home.stateVersion = lib.mkDefault config.system.stateVersion; } ];
|
||||
};
|
||||
|
||||
hm.imports = [
|
||||
#
|
||||
# hostname
|
||||
#
|
||||
{ _module.args = { inherit hostname; }; }
|
||||
|
||||
#
|
||||
# home modules
|
||||
#
|
||||
./hydrogen/home/programs.nix
|
||||
./hydrogen/home/dev.nix
|
||||
|
||||
../homeModules/common/btop
|
||||
../homeModules/common/fish
|
||||
../homeModules/common/starship
|
||||
../homeModules/common/fzf.nix
|
||||
../homeModules/common/tmux
|
||||
../homeModules/common/vim
|
||||
../homeModules/common/direnv.nix
|
||||
../homeModules/common/git.nix
|
||||
../homeModules/common/gpg.nix
|
||||
../homeModules/common/leana.nix
|
||||
../homeModules/common/locale.nix
|
||||
../homeModules/common/packages.nix
|
||||
../homeModules/common/tealdeer.nix
|
||||
|
||||
../homeModules/extra/tmux-fish-integration.nix
|
||||
|
||||
#
|
||||
# Extern modules
|
||||
#
|
||||
(sources.agenix + "/modules/age-home.nix")
|
||||
];
|
||||
}
|
||||
|
||||
#
|
||||
# Secrets
|
||||
#
|
||||
{
|
||||
age.secrets = {
|
||||
wpa_password.file = "${../secrets/wpa_password.age}";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
28
nix/configurations/hydrogen/home/dev.nix
Normal file
28
nix/configurations/hydrogen/home/dev.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [
|
||||
pkgs.pyright # python
|
||||
];
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
signing.signByDefault = false; # no need to setup the key
|
||||
};
|
||||
|
||||
programs.gpg.enable = true;
|
||||
|
||||
nix = {
|
||||
settings = {
|
||||
extra-substituters = [
|
||||
"https://ghc-nix.cachix.org"
|
||||
"https://haskell-language-server.cachix.org"
|
||||
"https://cache.iog.io"
|
||||
];
|
||||
extra-trusted-public-keys = [
|
||||
"ghc-nix.cachix.org-1:ziC/I4BPqeA4VbtOFpFpu6D1t6ymFvRWke/lc2+qjcg="
|
||||
"haskell-language-server.cachix.org-1:juFfHrwkOxqIOZShtC4YC1uT1bBcq2RSvC7OMKx0Nz8="
|
||||
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
56
nix/configurations/hydrogen/home/programs.nix
Normal file
56
nix/configurations/hydrogen/home/programs.nix
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
home.sessionVariables =
|
||||
let
|
||||
fishCfg = config.programs.fish;
|
||||
in
|
||||
{
|
||||
"SHELL" = lib.mkIf fishCfg.enable (lib.getExe fishCfg.package);
|
||||
};
|
||||
|
||||
home.packages = [
|
||||
pkgs.nmap
|
||||
pkgs.stow
|
||||
pkgs.zip
|
||||
pkgs.unzip
|
||||
pkgs.gnutar
|
||||
pkgs.p7zip
|
||||
pkgs.bc
|
||||
pkgs.dig
|
||||
pkgs.hutils
|
||||
pkgs.miniserve
|
||||
pkgs.nix-which
|
||||
|
||||
# # pretty tui tools
|
||||
# pkgs.dust
|
||||
# pkgs.tokei
|
||||
# pkgs.hyperfine
|
||||
# pkgs.watchexec
|
||||
# pkgs.onefetch
|
||||
# pkgs.just
|
||||
];
|
||||
|
||||
programs = {
|
||||
neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
};
|
||||
lazygit.enable = true;
|
||||
fish.enable = true;
|
||||
starship.enable = true;
|
||||
tmux.enable = true;
|
||||
direnv.enable = true;
|
||||
ripgrep.enable = true;
|
||||
|
||||
btop.enable = true;
|
||||
};
|
||||
|
||||
services = {
|
||||
gpg-agent.enable = true;
|
||||
};
|
||||
}
|
||||
36
nix/configurations/hydrogen/nixos/connectivity.nix
Normal file
36
nix/configurations/hydrogen/nixos/connectivity.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
users.users.root.openssh.authorizedKeys.keys = import ../../../identities.nix;
|
||||
|
||||
networking = {
|
||||
networkmanager.enable = lib.mkForce false;
|
||||
|
||||
firewall.allowedTCPPorts = [
|
||||
8080
|
||||
|
||||
# For 'localsend'
|
||||
# https://github.com/localsend/localsend?tab=readme-ov-file#setup
|
||||
53317
|
||||
];
|
||||
|
||||
# To enable roaming https://wiki.archlinux.org/title/Wpa_supplicant#Roaming
|
||||
wireless = {
|
||||
enable = true;
|
||||
userControlled.enable = true;
|
||||
secretsFile = config.age.secrets.wpa_password.path;
|
||||
scanOnLowSignal = false;
|
||||
networks =
|
||||
let
|
||||
fromList = import ../../../networks/wpa_supplicant-compat.nix;
|
||||
networks = import ../../../networks/list.nix;
|
||||
in
|
||||
fromList (builtins.filter (x: x.ssid == "~") networks);
|
||||
};
|
||||
};
|
||||
|
||||
hardware.bluetooth.enable = true;
|
||||
}
|
||||
19
nix/configurations/hydrogen/nixos/misc.nix
Normal file
19
nix/configurations/hydrogen/nixos/misc.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
system.stateVersion = "25.05";
|
||||
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/var/swapfile";
|
||||
size = 1024; # MB
|
||||
}
|
||||
];
|
||||
|
||||
# Related https://github.com/NixOS/nixpkgs/issues/154163#issuecomment-1350599022
|
||||
#
|
||||
# modprobe: FATAL: Module sun4i-drm not found in directory /nix/store/gvvwpdckzcr4iamp1iyrqw3nzb7bg6c4-linux-rpi-6.6.51-stable_20241008-modules/lib/modules/6.6.51
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
makeModulesClosure = x: prev.makeModulesClosure (x // { allowMissing = true; });
|
||||
})
|
||||
];
|
||||
}
|
||||
20
nix/configurations/hydrogen/nixos/programs.nix
Normal file
20
nix/configurations/hydrogen/nixos/programs.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = [
|
||||
pkgs.man-pages
|
||||
pkgs.man-pages-posix
|
||||
];
|
||||
|
||||
#
|
||||
# Programs
|
||||
#
|
||||
programs = {
|
||||
vim.enable = true;
|
||||
vim.defaultEditor = true;
|
||||
|
||||
git.enable = true;
|
||||
};
|
||||
|
||||
# Helps with kitty when ssh from remote
|
||||
environment.enableAllTerminfo = true;
|
||||
}
|
||||
|
|
@ -4,23 +4,33 @@
|
|||
# figured out an elegant (enough) way to do it while keeping my secrets
|
||||
# encrypted.
|
||||
#
|
||||
let
|
||||
sources = import ../../npins;
|
||||
in
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
../nixosModules/common/system-nixconf.nix
|
||||
../nixosModules/common/sudo-conf.nix
|
||||
|
||||
(modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix")
|
||||
];
|
||||
|
||||
nix.settings = {
|
||||
extra-substituters = ["https://leana8959.cachix.org"];
|
||||
extra-trusted-substituters = ["https://leana8959.cachix.org"];
|
||||
extra-trusted-public-keys = ["leana8959.cachix.org-1:CxQSAp8lcgMv8Me459of0jdXRW2tcyeYRKTiiUq8z0M="];
|
||||
experimental-features = ["nix-command" "flakes"];
|
||||
extra-substituters = [ "https://leana8959.cachix.org" ];
|
||||
extra-trusted-substituters = [ "https://leana8959.cachix.org" ];
|
||||
extra-trusted-public-keys = [
|
||||
"leana8959.cachix.org-1:CxQSAp8lcgMv8Me459of0jdXRW2tcyeYRKTiiUq8z0M="
|
||||
];
|
||||
experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
};
|
||||
|
||||
nixpkgs = {
|
||||
|
|
@ -34,6 +44,15 @@
|
|||
];
|
||||
};
|
||||
|
||||
system.nixos =
|
||||
let
|
||||
rev = lib.substring 0 8 sources.nixpkgs.revision;
|
||||
in
|
||||
{
|
||||
versionSuffix = "-git:${rev}";
|
||||
revision = rev;
|
||||
};
|
||||
|
||||
isoImage.squashfsCompression = "zstd -Xcompression-level 3";
|
||||
|
||||
environment.systemPackages = [
|
||||
|
|
@ -44,7 +63,7 @@
|
|||
pkgs.btop
|
||||
];
|
||||
|
||||
networking.firewall.allowedTCPPorts = [8080]; # in case you wanna nc
|
||||
networking.firewall.allowedTCPPorts = [ 8080 ]; # in case you wanna nc
|
||||
|
||||
programs.tmux.enable = true;
|
||||
users.users.nixos.shell = pkgs.fish;
|
||||
|
|
@ -63,4 +82,8 @@
|
|||
boot.extraModprobeConfig = ''
|
||||
options cfg80211 ieee80211_regdom="US"
|
||||
'';
|
||||
|
||||
# If we run out of memory during building, the machine would hang, and that sucks.
|
||||
# Nothing worse than restarting the installation from scratch
|
||||
services.earlyoom.enable = true;
|
||||
}
|
||||
|
|
|
|||
166
nix/configurations/iron.nix
Normal file
166
nix/configurations/iron.nix
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
# Entry point to cherry pick modules
|
||||
let
|
||||
sources = import ../../npins;
|
||||
|
||||
hostname = "iron";
|
||||
username = "leana";
|
||||
in
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib.modules) mkAliasOptionModule;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
#
|
||||
# Shorthands
|
||||
#
|
||||
(mkAliasOptionModule [ "me" ] [ "users" "users" username ])
|
||||
(mkAliasOptionModule [ "hm" ] [ "home-manager" "users" username ])
|
||||
|
||||
#
|
||||
# hostname
|
||||
#
|
||||
{ _module.args = { inherit hostname; }; }
|
||||
|
||||
#
|
||||
# nixpkgs
|
||||
#
|
||||
{
|
||||
# affect the generated nix.conf, doesn't need to be turned off during nixos-install
|
||||
nix = {
|
||||
distributedBuilds = true;
|
||||
settings.builders-use-substitutes = true;
|
||||
|
||||
# don't use `nixpkgs.flake.source`, it uses flake so it double fetches
|
||||
nixPath = [ "nixpkgs=${sources.nixpkgs}" ];
|
||||
};
|
||||
|
||||
nixpkgs = {
|
||||
overlays = map import [
|
||||
../overlays/agenix.nix
|
||||
../overlays/disko.nix
|
||||
../overlays/nur.nix
|
||||
../overlays/nix-tree.nix
|
||||
../overlays/nil.nix
|
||||
../overlays/dix.nix
|
||||
|
||||
../packages/overlay.nix
|
||||
# use lix everywhere and wrap it with nom
|
||||
../overlays/lix.nix
|
||||
../overlays/nix-monitored.nix
|
||||
];
|
||||
};
|
||||
|
||||
nix.package = pkgs.nix-monitored;
|
||||
|
||||
system.nixos =
|
||||
let
|
||||
rev = lib.substring 0 8 sources.nixpkgs.revision;
|
||||
in
|
||||
{
|
||||
versionSuffix = "-git:${rev}";
|
||||
revision = rev;
|
||||
};
|
||||
}
|
||||
|
||||
#
|
||||
# NixOS modules
|
||||
#
|
||||
./iron/nixos/hardware-configuration.nix # generated
|
||||
./iron/nixos/fs.nix
|
||||
|
||||
./iron/nixos/battery.nix
|
||||
|
||||
./iron/nixos/connectivity.nix
|
||||
./iron/nixos/input.nix
|
||||
|
||||
./iron/nixos/misc.nix
|
||||
|
||||
./iron/nixos/display.nix
|
||||
|
||||
./iron/nixos/locale.nix
|
||||
./iron/nixos/programs.nix
|
||||
|
||||
../nixosModules/common/disable-command-not-found.nix
|
||||
../nixosModules/common/network.nix
|
||||
../nixosModules/common/sudo-conf.nix
|
||||
../nixosModules/common/system-nixconf.nix
|
||||
|
||||
../nixosModules/extra/leana.nix
|
||||
|
||||
#
|
||||
# Extern modules
|
||||
#
|
||||
(sources.disko + "/module.nix")
|
||||
../disko/iron/btrfs.nix
|
||||
|
||||
(sources.agenix + "/modules/age.nix")
|
||||
|
||||
../nixosModules/extra/macbook-pro-radeon.nix
|
||||
../nixosModules/extra/macbook-swap-cmd-opt.nix
|
||||
../nixosModules/extra/macbook-swap-fn-ctrl.nix
|
||||
../nixosModules/extra/macbook-broacom-b43.nix
|
||||
|
||||
#
|
||||
# home-manager
|
||||
#
|
||||
(sources.home-manager + "/nixos")
|
||||
{
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
sharedModules = [ { home.stateVersion = lib.mkDefault config.system.stateVersion; } ];
|
||||
};
|
||||
|
||||
hm.imports = [
|
||||
#
|
||||
# hostname
|
||||
#
|
||||
{ _module.args = { inherit hostname; }; }
|
||||
|
||||
#
|
||||
# home modules
|
||||
#
|
||||
./iron/home/programs.nix
|
||||
|
||||
../homeModules/common/btop
|
||||
../homeModules/common/fish
|
||||
../homeModules/common/starship
|
||||
../homeModules/common/tmux
|
||||
../homeModules/common/vim
|
||||
../homeModules/common/direnv.nix
|
||||
../homeModules/common/fzf.nix
|
||||
../homeModules/common/git.nix
|
||||
../homeModules/common/gpg.nix
|
||||
../homeModules/common/leana.nix
|
||||
../homeModules/common/locale.nix
|
||||
../homeModules/common/lazygit.nix
|
||||
../homeModules/common/packages.nix
|
||||
../homeModules/common/password-store.nix
|
||||
../homeModules/common/tealdeer.nix
|
||||
../homeModules/common/user-nixconf.nix
|
||||
|
||||
../homeModules/extra/tmux-fish-integration.nix
|
||||
|
||||
#
|
||||
# Extern modules
|
||||
#
|
||||
(sources.agenix + "/modules/age-home.nix")
|
||||
];
|
||||
}
|
||||
|
||||
#
|
||||
# Secrets
|
||||
#
|
||||
{
|
||||
age.secrets = {
|
||||
wpa_password.file = "${../secrets/wpa_password.age}";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
78
nix/configurations/iron/home/programs.nix
Normal file
78
nix/configurations/iron/home/programs.nix
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
home.sessionPath = [
|
||||
"${config.home.homeDirectory}/.local/bin"
|
||||
];
|
||||
|
||||
home.sessionVariables =
|
||||
let
|
||||
fishCfg = config.programs.fish;
|
||||
in
|
||||
{
|
||||
"SHELL" = lib.mkIf fishCfg.enable (lib.getExe fishCfg.package);
|
||||
};
|
||||
|
||||
home.packages = [
|
||||
pkgs.nmap
|
||||
pkgs.stow
|
||||
pkgs.zip
|
||||
pkgs.unzip
|
||||
pkgs.gnutar
|
||||
pkgs.p7zip
|
||||
pkgs.bc
|
||||
pkgs.dig
|
||||
pkgs.hutils
|
||||
pkgs.miniserve
|
||||
pkgs.agenix
|
||||
pkgs.nix-which
|
||||
|
||||
# pretty tui tools
|
||||
pkgs.dust
|
||||
pkgs.tokei
|
||||
pkgs.hyperfine
|
||||
pkgs.watchexec
|
||||
pkgs.onefetch
|
||||
pkgs.just
|
||||
|
||||
# nix tools
|
||||
pkgs.alejandra
|
||||
pkgs.nurl
|
||||
pkgs.dix
|
||||
pkgs.niv
|
||||
pkgs.npins
|
||||
pkgs.nix-tree
|
||||
pkgs.nh
|
||||
];
|
||||
|
||||
programs = {
|
||||
neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
};
|
||||
lazygit.enable = true;
|
||||
fish = {
|
||||
enable = true;
|
||||
shellAbbrs = {
|
||||
"fdoc" = "find ~/Documents -name";
|
||||
};
|
||||
};
|
||||
starship.enable = true;
|
||||
tmux.enable = true;
|
||||
direnv.enable = true;
|
||||
ripgrep.enable = true;
|
||||
password-store.enable = true;
|
||||
tealdeer.enable = true;
|
||||
|
||||
btop.enable = true;
|
||||
cmus.enable = true;
|
||||
};
|
||||
|
||||
services = {
|
||||
gpg-agent.enable = true;
|
||||
};
|
||||
}
|
||||
7
nix/configurations/iron/nixos/battery.nix
Normal file
7
nix/configurations/iron/nixos/battery.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
services.logind.settings = {
|
||||
# It's a server :sparkles:
|
||||
Login.HandleLidSwitch = "ignore";
|
||||
Login.HandleLidSwitchDocked = "ignore";
|
||||
};
|
||||
}
|
||||
38
nix/configurations/iron/nixos/connectivity.nix
Normal file
38
nix/configurations/iron/nixos/connectivity.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
users.users.root.openssh.authorizedKeys.keys = import ../../../identities.nix;
|
||||
|
||||
networking = {
|
||||
networkmanager.enable = lib.mkForce false;
|
||||
|
||||
firewall.allowedTCPPorts = [
|
||||
8080
|
||||
|
||||
# For 'localsend'
|
||||
# https://github.com/localsend/localsend?tab=readme-ov-file#setup
|
||||
53317
|
||||
];
|
||||
|
||||
# To enable roaming https://wiki.archlinux.org/title/Wpa_supplicant#Roaming
|
||||
wireless = {
|
||||
enable = true;
|
||||
userControlled.enable = true;
|
||||
secretsFile = config.age.secrets.wpa_password.path;
|
||||
scanOnLowSignal = false;
|
||||
networks =
|
||||
let
|
||||
fromList = import ../../../networks/wpa_supplicant-compat.nix;
|
||||
networks = import ../../../networks/list.nix;
|
||||
in
|
||||
fromList networks;
|
||||
};
|
||||
};
|
||||
|
||||
services.mullvad-vpn.enable = true;
|
||||
|
||||
hardware.bluetooth.enable = true;
|
||||
}
|
||||
4
nix/configurations/iron/nixos/display.nix
Normal file
4
nix/configurations/iron/nixos/display.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
me.extraGroups = [ "video" ];
|
||||
programs.light.enable = true;
|
||||
}
|
||||
24
nix/configurations/iron/nixos/fs.nix
Normal file
24
nix/configurations/iron/nixos/fs.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
services.btrfs.autoScrub = {
|
||||
enable = true;
|
||||
fileSystems = [
|
||||
"/"
|
||||
"/home"
|
||||
"/nix"
|
||||
];
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
# tmux-sessionizer directories
|
||||
"d /home/leana/r 0700 leana leana - -"
|
||||
"d /home/leana/pg 0700 leana leana 4w -"
|
||||
"d /home/leana/wt 0700 leana leana - -"
|
||||
];
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.lsof
|
||||
pkgs.smartmontools
|
||||
pkgs.compsize
|
||||
];
|
||||
}
|
||||
41
nix/configurations/iron/nixos/hardware-configuration.nix
Normal file
41
nix/configurations/iron/nixos/hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"uhci_hcd"
|
||||
"ehci_pci"
|
||||
"ahci"
|
||||
"firewire_ohci"
|
||||
"usbhid"
|
||||
"uas"
|
||||
"sd_mod"
|
||||
"sr_mod"
|
||||
"sdhci_pci"
|
||||
];
|
||||
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp2s0f0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp3s0b1.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
11
nix/configurations/iron/nixos/input.nix
Normal file
11
nix/configurations/iron/nixos/input.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
services.xserver.xkb = {
|
||||
layout = "us";
|
||||
variant = "dvorak";
|
||||
options = builtins.concatStringsSep "," [
|
||||
"caps:swapescape"
|
||||
"compose:ralt"
|
||||
];
|
||||
};
|
||||
console.useXkbConfig = true;
|
||||
}
|
||||
53
nix/configurations/iron/nixos/locale.nix
Normal file
53
nix/configurations/iron/nixos/locale.nix
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
# https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
||||
# `timedatectl list-timezones`
|
||||
time.timeZone = "Asia/Taipei";
|
||||
|
||||
i18n = {
|
||||
defaultLocale = "en_US.UTF-8";
|
||||
extraLocales = [
|
||||
"en_US.UTF-8/UTF-8"
|
||||
"fr_FR.UTF-8/UTF-8"
|
||||
"zh_TW.UTF-8/UTF-8"
|
||||
];
|
||||
extraLocaleSettings =
|
||||
# A list of env variables you might want to set
|
||||
#
|
||||
# "LC_CTYPE"
|
||||
# "LC_NUMERIC"
|
||||
# "LC_TIME"
|
||||
# "LC_COLLATE"
|
||||
# "LC_MONETARY"
|
||||
# "LC_MESSAGES"
|
||||
# "LC_PAPER"
|
||||
# "LC_NAME"
|
||||
# "LC_ADDRESS"
|
||||
# "LC_TELEPHONE"
|
||||
# "LC_MEASUREMENT"
|
||||
# "LC_IDENTIFICATION"
|
||||
let
|
||||
genLocale = locale: lib.flip lib.genAttrs (_: locale);
|
||||
in
|
||||
# - xscreensaver freaks out on the time display
|
||||
# - evolution add event becomes hard to use
|
||||
# https://gitlab.gnome.org/GNOME/evolution/-/issues/3120
|
||||
genLocale "fr_FR.UTF-8" [
|
||||
"LC_TIME"
|
||||
]
|
||||
// genLocale "zh_TW.UTF-8" [
|
||||
"LC_MONETARY"
|
||||
"LC_ADDRESS"
|
||||
];
|
||||
};
|
||||
|
||||
# Wireless Regulatory Domain, uses ISO / IEC 3166 country code
|
||||
#
|
||||
# links:
|
||||
# https://community.frame.work/t/framework-nixos-linux-users-self-help/31426/77
|
||||
# https://wireless.docs.kernel.org/en/latest/en/developers/regulatory.html#the-ieee80211-regdom-module-parameter
|
||||
hardware.wirelessRegulatoryDatabase = true;
|
||||
boot.extraModprobeConfig = ''
|
||||
options cfg80211 ieee80211_regdom="TW"
|
||||
'';
|
||||
}
|
||||
11
nix/configurations/iron/nixos/misc.nix
Normal file
11
nix/configurations/iron/nixos/misc.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
system.stateVersion = "25.05";
|
||||
|
||||
boot.loader = {
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
editor = false;
|
||||
};
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
}
|
||||
17
nix/configurations/iron/nixos/programs.nix
Normal file
17
nix/configurations/iron/nixos/programs.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = [
|
||||
pkgs.man-pages
|
||||
pkgs.man-pages-posix
|
||||
];
|
||||
|
||||
#
|
||||
# Programs
|
||||
#
|
||||
programs = {
|
||||
vim.enable = true;
|
||||
vim.defaultEditor = true;
|
||||
|
||||
git.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -5,223 +5,239 @@ let
|
|||
hostname = "vanadium";
|
||||
username = "leana";
|
||||
in
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkAliasOptionModule;
|
||||
in {
|
||||
imports = [
|
||||
#
|
||||
# Shorthands
|
||||
#
|
||||
(mkAliasOptionModule ["me"] ["users" "users" username])
|
||||
(mkAliasOptionModule ["hm"] ["home-manager" "users" username])
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib.modules) mkAliasOptionModule;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
#
|
||||
# Shorthands
|
||||
#
|
||||
(mkAliasOptionModule [ "me" ] [ "users" "users" username ])
|
||||
(mkAliasOptionModule [ "hm" ] [ "home-manager" "users" username ])
|
||||
|
||||
#
|
||||
# hostname
|
||||
#
|
||||
{_module.args = {inherit hostname;};}
|
||||
#
|
||||
# hostname
|
||||
#
|
||||
{ _module.args = { inherit hostname; }; }
|
||||
|
||||
#
|
||||
# nixpkgs
|
||||
#
|
||||
{
|
||||
# affect the generated nix.conf, doesn't need to be turned off during nixos-install
|
||||
nix = {
|
||||
distributedBuilds = true;
|
||||
settings.builders-use-substitutes = true;
|
||||
#
|
||||
# nixpkgs
|
||||
#
|
||||
{
|
||||
# affect the generated nix.conf, doesn't need to be turned off during nixos-install
|
||||
nix = {
|
||||
distributedBuilds = true;
|
||||
settings.builders-use-substitutes = true;
|
||||
|
||||
# don't use `nixpkgs.flake.source`, it uses flake so it double fetches
|
||||
nixPath = [ "nixpkgs=${sources.nixpkgs}" ];
|
||||
};
|
||||
|
||||
nixpkgs = {
|
||||
config = {
|
||||
# For btop, ROCm support is needed for AMD GPU
|
||||
# https://github.com/aristocratos/btop?tab=readme-ov-file#gpu-compatibility
|
||||
rocmSupport = true;
|
||||
};
|
||||
|
||||
nixpkgs = {
|
||||
config = {
|
||||
# For btop, ROCm support is needed for AMD GPU
|
||||
# https://github.com/aristocratos/btop?tab=readme-ov-file#gpu-compatibility
|
||||
rocmSupport = true;
|
||||
};
|
||||
overlays = map import [
|
||||
../overlays/agenix.nix
|
||||
../overlays/disko.nix
|
||||
../overlays/nur.nix
|
||||
../overlays/wired-notify.nix
|
||||
../overlays/nix-tree.nix
|
||||
../overlays/wallpapers.nix
|
||||
../overlays/nil.nix
|
||||
../overlays/dix.nix
|
||||
../overlays/eepy.nix
|
||||
../overlays/calibre-no-mime.nix
|
||||
../overlays/fcitx5-table-extra-taiwanese.nix
|
||||
|
||||
overlays =
|
||||
map import
|
||||
[
|
||||
../overlays/agenix.nix
|
||||
../overlays/disko.nix
|
||||
../overlays/nur.nix
|
||||
../overlays/wired-notify.nix
|
||||
../overlays/nix-tree.nix
|
||||
../overlays/wallpapers.nix
|
||||
../overlays/nil.nix
|
||||
../overlays/dix.nix
|
||||
../overlays/eepy.nix
|
||||
../overlays/calibre-no-mime.nix
|
||||
../overlays/fcitx5-table-extra-taiwanese.nix
|
||||
../overlays/iosevka.nix
|
||||
../packages/overlay.nix
|
||||
|
||||
../overlays/iosevka.nix
|
||||
../packages/overlay.nix
|
||||
./vanadium/overlay.nix
|
||||
./vanadium/kernel-overlay.nix
|
||||
|
||||
./vanadium/overlay.nix
|
||||
# removed, but I need it for PLFA!
|
||||
../overlays/pin-emacs28.nix
|
||||
|
||||
# removed, but I need it for PLFA!
|
||||
../overlays/pin-emacs28.nix
|
||||
]
|
||||
# use lix everywhere and wrap it with nom
|
||||
++ [
|
||||
(import (sources.lix-module + "/overlay.nix") {inherit (sources) lix;})
|
||||
(import ../overlays/nix-monitored.nix)
|
||||
];
|
||||
|
||||
# Set NIX_PATH and flake registry at the same time
|
||||
# https://github.com/NixOS/nixpkgs/pull/254405
|
||||
flake.source = sources.nixpkgs;
|
||||
};
|
||||
|
||||
nix.package = pkgs.nix-monitored;
|
||||
|
||||
system.nixos.version = lib.substring 0 8 sources.nixpkgs.revision;
|
||||
}
|
||||
|
||||
#
|
||||
# NixOS modules
|
||||
#
|
||||
./vanadium/nixos/hardware-configuration.nix # generated
|
||||
./vanadium/nixos/fs.nix
|
||||
./vanadium/nixos/restic.nix
|
||||
|
||||
./vanadium/nixos/battery.nix
|
||||
|
||||
./vanadium/nixos/audio.nix
|
||||
./vanadium/nixos/connectivity.nix
|
||||
./vanadium/nixos/secure_dns.nix
|
||||
./vanadium/nixos/input.nix
|
||||
|
||||
./vanadium/nixos/misc.nix
|
||||
|
||||
./vanadium/nixos/display.nix
|
||||
./vanadium/nixos/gui.nix
|
||||
|
||||
./vanadium/nixos/locale.nix
|
||||
./vanadium/nixos/unfree-predicate.nix
|
||||
./vanadium/nixos/programs.nix
|
||||
|
||||
../nixosModules/common/disable-command-not-found.nix
|
||||
../nixosModules/common/network.nix
|
||||
../nixosModules/common/sudo-conf.nix
|
||||
../nixosModules/common/system-nixconf.nix
|
||||
../nixosModules/common/xscreensaver.nix
|
||||
|
||||
../nixosModules/extra/zram.nix
|
||||
../nixosModules/extra/leana.nix
|
||||
|
||||
#
|
||||
# Extern modules
|
||||
#
|
||||
(sources.disko + "/module.nix")
|
||||
../disko/vanadium/btrfs.nix
|
||||
|
||||
(sources.agenix + "/modules/age.nix")
|
||||
|
||||
(import sources.url-eater).nixosModules.default
|
||||
|
||||
(sources.nixos-hardware + "/framework/13-inch/7040-amd")
|
||||
|
||||
#
|
||||
# home-manager
|
||||
#
|
||||
(sources.home-manager + "/nixos")
|
||||
{
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
sharedModules = [{home.stateVersion = lib.mkDefault config.system.stateVersion;}];
|
||||
};
|
||||
|
||||
hm.imports = [
|
||||
#
|
||||
# hostname
|
||||
#
|
||||
{_module.args = {inherit hostname;};}
|
||||
|
||||
#
|
||||
# home modules
|
||||
#
|
||||
./vanadium/home/programs.nix
|
||||
./vanadium/home/misc.nix
|
||||
|
||||
./vanadium/home/firefox.nix
|
||||
./vanadium/home/xmobar.nix
|
||||
|
||||
# Language server packages, etc
|
||||
./vanadium/home/dev.nix
|
||||
|
||||
../homeModules/common/btop
|
||||
../homeModules/common/cmus
|
||||
../homeModules/common/fcitx5
|
||||
../homeModules/common/fish
|
||||
../homeModules/common/nushell.nix
|
||||
../homeModules/common/starship
|
||||
../homeModules/common/tmux
|
||||
../homeModules/common/vim
|
||||
../homeModules/common/wired
|
||||
../homeModules/common/atuin.nix
|
||||
../homeModules/common/direnv.nix
|
||||
../homeModules/common/feh.nix
|
||||
../homeModules/common/firefox.nix
|
||||
../homeModules/common/fzf.nix
|
||||
../homeModules/common/git.nix
|
||||
../homeModules/common/gpg.nix
|
||||
../homeModules/common/kitty.nix
|
||||
../homeModules/common/leana.nix
|
||||
../homeModules/common/locale.nix
|
||||
../homeModules/common/lazygit.nix
|
||||
../homeModules/common/packages.nix
|
||||
../homeModules/common/password-store.nix
|
||||
../homeModules/common/sioyek.nix
|
||||
../homeModules/common/tealdeer.nix
|
||||
../homeModules/common/user-nixconf.nix
|
||||
|
||||
../homeModules/extra/tmux-fish-integration.nix
|
||||
|
||||
#
|
||||
# Extern modules
|
||||
#
|
||||
(sources.agenix + "/modules/age-home.nix")
|
||||
(import sources.wired-notify).homeManagerModules.default
|
||||
# use lix everywhere and wrap it with nom
|
||||
../overlays/lix.nix
|
||||
../overlays/nix-monitored.nix
|
||||
];
|
||||
}
|
||||
};
|
||||
|
||||
#
|
||||
# Secrets
|
||||
#
|
||||
{
|
||||
age.secrets = {
|
||||
wpa_password.file = "${../secrets/wpa_password.age}";
|
||||
nix.package = pkgs.nix-monitored;
|
||||
|
||||
restic_backblaze_pwd.file = "${../secrets/restic_backblaze_pwd.age}";
|
||||
restic_backblaze_repo.file = "${../secrets/restic_backblaze_repo.age}";
|
||||
restic_backblaze_env.file = "${../secrets/restic_backblaze_env.age}";
|
||||
|
||||
four_pwd.file = "${../secrets/four_pwd.age}";
|
||||
restic_four_pwd.file = "${../secrets/restic_four_pwd.age}";
|
||||
|
||||
sgbk_pwd.file = "${../secrets/sgbk_pwd.age}";
|
||||
restic_sgbk_pwd.file = "${../secrets/restic_sgbk_pwd.age}";
|
||||
|
||||
two_pwd.file = "${../secrets/two_pwd.age}";
|
||||
system.nixos =
|
||||
let
|
||||
rev = lib.substring 0 8 sources.nixpkgs.revision;
|
||||
in
|
||||
{
|
||||
versionSuffix = "-git:${rev}";
|
||||
revision = rev;
|
||||
};
|
||||
}
|
||||
|
||||
hm = {
|
||||
age.secrets = {
|
||||
sshconfig = {
|
||||
file = "${../secrets/sshconfig.age}";
|
||||
path = "/home/leana/.ssh/config";
|
||||
};
|
||||
iambconfig = {
|
||||
file = "${../secrets/iambconfig.age}";
|
||||
path = "/home/leana/.config/iamb/config.toml";
|
||||
};
|
||||
#
|
||||
# NixOS modules
|
||||
#
|
||||
./vanadium/nixos/hardware-configuration.nix # generated
|
||||
./vanadium/nixos/fs.nix
|
||||
./vanadium/nixos/restic.nix
|
||||
|
||||
./vanadium/nixos/battery.nix
|
||||
|
||||
./vanadium/nixos/audio.nix
|
||||
./vanadium/nixos/connectivity.nix
|
||||
./vanadium/nixos/input.nix
|
||||
|
||||
./vanadium/nixos/misc.nix
|
||||
|
||||
./vanadium/nixos/display.nix
|
||||
./vanadium/nixos/gui.nix
|
||||
|
||||
./vanadium/nixos/locale.nix
|
||||
./vanadium/nixos/unfree-predicate.nix
|
||||
./vanadium/nixos/programs.nix
|
||||
|
||||
../nixosModules/common/fish.nix
|
||||
../nixosModules/common/disable-command-not-found.nix
|
||||
../nixosModules/common/network.nix
|
||||
../nixosModules/common/sudo-conf.nix
|
||||
../nixosModules/common/system-nixconf.nix
|
||||
../nixosModules/common/xscreensaver.nix
|
||||
|
||||
# QUIRK:
|
||||
# Had issue when building the installer as it fails to bootstrap itself
|
||||
# Might be useful to disable for the first build.
|
||||
# ../nixosModules/extra/secure_dns.nix
|
||||
../nixosModules/extra/zram.nix
|
||||
../nixosModules/extra/leana.nix
|
||||
|
||||
#
|
||||
# Extern modules
|
||||
#
|
||||
(sources.disko + "/module.nix")
|
||||
../disko/vanadium/btrfs.nix
|
||||
|
||||
(sources.agenix + "/modules/age.nix")
|
||||
|
||||
sources.url-eater.asFlake.nixosModules.default
|
||||
|
||||
(sources.nixos-hardware + "/framework/13-inch/7040-amd")
|
||||
|
||||
#
|
||||
# home-manager
|
||||
#
|
||||
(sources.home-manager + "/nixos")
|
||||
{
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
sharedModules = [ { home.stateVersion = lib.mkDefault config.system.stateVersion; } ];
|
||||
};
|
||||
|
||||
hm.imports = [
|
||||
#
|
||||
# hostname
|
||||
#
|
||||
{ _module.args = { inherit hostname; }; }
|
||||
|
||||
#
|
||||
# home modules
|
||||
#
|
||||
./vanadium/home/programs.nix
|
||||
./vanadium/home/misc.nix
|
||||
./vanadium/home/gtk.nix
|
||||
|
||||
./vanadium/home/zen-browser.nix
|
||||
./vanadium/home/firefox.nix
|
||||
./vanadium/home/xmobar.nix
|
||||
|
||||
# Language server packages, etc
|
||||
./vanadium/home/dev.nix
|
||||
|
||||
../homeModules/common/btop
|
||||
../homeModules/common/cmus
|
||||
../homeModules/common/fcitx5
|
||||
../homeModules/common/fish
|
||||
../homeModules/common/nushell.nix
|
||||
../homeModules/common/starship
|
||||
../homeModules/common/tmux
|
||||
../homeModules/common/vim
|
||||
../homeModules/common/wired
|
||||
../homeModules/common/vlc.nix
|
||||
../homeModules/common/atuin.nix
|
||||
../homeModules/common/direnv.nix
|
||||
../homeModules/common/feh.nix
|
||||
../homeModules/common/zen-browser.nix
|
||||
../homeModules/common/firefox.nix
|
||||
../homeModules/common/fzf.nix
|
||||
../homeModules/common/git.nix
|
||||
../homeModules/common/gpg.nix
|
||||
../homeModules/common/kitty.nix
|
||||
../homeModules/common/leana.nix
|
||||
../homeModules/common/locale.nix
|
||||
../homeModules/common/lazygit.nix
|
||||
../homeModules/common/packages.nix
|
||||
../homeModules/common/password-store.nix
|
||||
../homeModules/common/sioyek.nix
|
||||
../homeModules/common/tealdeer.nix
|
||||
../homeModules/common/user-nixconf.nix
|
||||
|
||||
../homeModules/extra/tmux-fish-integration.nix
|
||||
|
||||
#
|
||||
# Extern modules
|
||||
#
|
||||
(sources.agenix + "/modules/age-home.nix")
|
||||
sources.wired-notify.asFlake.homeManagerModules.default
|
||||
|
||||
sources.zen-browser.asFlake.homeModules.twilight
|
||||
];
|
||||
}
|
||||
|
||||
#
|
||||
# Secrets
|
||||
#
|
||||
{
|
||||
age.secrets = {
|
||||
wpa_password.file = "${../secrets/wpa_password.age}";
|
||||
|
||||
restic_backblaze_pwd.file = "${../secrets/restic_backblaze_pwd.age}";
|
||||
restic_backblaze_repo.file = "${../secrets/restic_backblaze_repo.age}";
|
||||
restic_backblaze_env.file = "${../secrets/restic_backblaze_env.age}";
|
||||
|
||||
four_pwd.file = "${../secrets/four_pwd.age}";
|
||||
restic_four_pwd.file = "${../secrets/restic_four_pwd.age}";
|
||||
|
||||
sgbk_pwd.file = "${../secrets/sgbk_pwd.age}";
|
||||
restic_sgbk_pwd.file = "${../secrets/restic_sgbk_pwd.age}";
|
||||
|
||||
two_pwd.file = "${../secrets/two_pwd.age}";
|
||||
};
|
||||
|
||||
hm = {
|
||||
age.secrets = {
|
||||
sshconfig = {
|
||||
file = "${../secrets/sshconfig.age}";
|
||||
path = "/home/leana/.ssh/config";
|
||||
};
|
||||
iambconfig = {
|
||||
file = "${../secrets/iambconfig.age}";
|
||||
path = "/home/leana/.config/iamb/config.toml";
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
home.packages = [
|
||||
# preview markdown
|
||||
pkgs.python3Packages.grip
|
||||
|
|
@ -35,74 +36,19 @@
|
|||
signing.signByDefault = true;
|
||||
maintenance = {
|
||||
enable = true;
|
||||
repositories =
|
||||
lib.map (path: config.home.homeDirectory + "/${path}")
|
||||
[
|
||||
"r/nixos/nixpkgs"
|
||||
];
|
||||
# We don't deal with worktree folders anyway
|
||||
repositories = lib.map (path: "${config.home.homeDirectory}/r/${path}") [
|
||||
"nixos/nixpkgs"
|
||||
"ghc/ghc"
|
||||
"haskell/cabal"
|
||||
];
|
||||
};
|
||||
includes = let
|
||||
hasconfigRemoteCondition = cfg: let
|
||||
cfg' = builtins.removeAttrs cfg ["url" "path"];
|
||||
path = cfg.path or "*/**";
|
||||
in [
|
||||
(cfg' // {condition = "hasconfig:remote.*.url:git@${cfg.url}:${path}";})
|
||||
(cfg' // {condition = "hasconfig:remote.*.url:https://${cfg.url}/${path}";})
|
||||
];
|
||||
|
||||
haskellIdentity = {
|
||||
init.defaultBranch = "main";
|
||||
user.name = "Léana Jiang";
|
||||
};
|
||||
|
||||
universityIdentity = {
|
||||
init.defaultBranch = "main";
|
||||
user = {
|
||||
name = "Léana CHIANG";
|
||||
email = "leana.chiang@etudiant.univ-rennes1.fr";
|
||||
signingKey = "0x32035DB97E777EEB";
|
||||
};
|
||||
};
|
||||
|
||||
blameIgnore = {
|
||||
blame.ignoreRevsFile = ".git-blame-ignore-revs";
|
||||
};
|
||||
in
|
||||
builtins.concatMap hasconfigRemoteCondition [
|
||||
# Univ stuff
|
||||
{
|
||||
url = "gitlab.istic.univ-rennes1.fr";
|
||||
contents = universityIdentity;
|
||||
}
|
||||
{
|
||||
url = "gitlab2.istic.univ-rennes1.fr";
|
||||
contents = universityIdentity;
|
||||
}
|
||||
|
||||
# Haskell
|
||||
{
|
||||
url = "gitlab.haskell.org";
|
||||
contents = haskellIdentity;
|
||||
}
|
||||
|
||||
# Blame
|
||||
# Turning this on globally will fail if the file doesn't exist
|
||||
{
|
||||
url = "github.com";
|
||||
path = "nixos/nixpkgs.git";
|
||||
contents = blameIgnore;
|
||||
}
|
||||
{
|
||||
url = "gitlab.haskell.org";
|
||||
path = "ghc/ghc.git";
|
||||
contents = blameIgnore;
|
||||
}
|
||||
{
|
||||
url = "github.com";
|
||||
path = "haskell/cabal.git";
|
||||
contents = blameIgnore;
|
||||
}
|
||||
];
|
||||
includes =
|
||||
let
|
||||
fromList = import ../../../git-identities/git-compat.nix;
|
||||
identities = import ../../../git-identities/list.nix;
|
||||
in
|
||||
fromList identities;
|
||||
};
|
||||
|
||||
programs.gpg.enable = true;
|
||||
|
|
@ -118,13 +64,15 @@
|
|||
nix = {
|
||||
settings = {
|
||||
extra-substituters = [
|
||||
"https://ghc-nix.cachix.org"
|
||||
"https://ghc-nix.cachix.org" # ghc nix-shell
|
||||
"https://ghc.cachix.org" # ghcs
|
||||
"https://haskell-language-server.cachix.org"
|
||||
"https://helix.cachix.org"
|
||||
"https://cache.iog.io"
|
||||
];
|
||||
extra-trusted-public-keys = [
|
||||
"ghc-nix.cachix.org-1:ziC/I4BPqeA4VbtOFpFpu6D1t6ymFvRWke/lc2+qjcg="
|
||||
"ghc.cachix.org-1:a751hwq9ydeP3Nr6h84iA9zSjxg9Z3uznqi4YBGjsiw="
|
||||
"haskell-language-server.cachix.org-1:juFfHrwkOxqIOZShtC4YC1uT1bBcq2RSvC7OMKx0Nz8="
|
||||
"helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="
|
||||
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
|
||||
|
|
|
|||
|
|
@ -2,109 +2,97 @@
|
|||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
inherit (pkgs) nur;
|
||||
in {
|
||||
in
|
||||
{
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
enable = false;
|
||||
|
||||
policies = {
|
||||
SearchEngines = {
|
||||
Default = "leta";
|
||||
Remove = ["Google"];
|
||||
Add = [
|
||||
{
|
||||
Name = "leta";
|
||||
Alias = "@lt";
|
||||
IconURL = "https://leta.mullvad.net/favicon.ico";
|
||||
URLTemplate = "https://leta.mullvad.net/search?q={searchTerms}&engine=brave";
|
||||
SuggestURLTemplate = "https://suggestqueries.google.com/complete/search?q={searchTerms}";
|
||||
}
|
||||
policies.SearchEngines.Add = [
|
||||
# Forges
|
||||
{
|
||||
Name = "GitHub";
|
||||
Alias = "@gh";
|
||||
IconURL = "https://github.com/favicon.ico";
|
||||
Description = "Your code yum yum";
|
||||
URLTemplate = "https://github.com/search?q={searchTerms}&type=repositories";
|
||||
}
|
||||
{
|
||||
Name = "GitHub (Code Search)";
|
||||
Alias = "@ghc";
|
||||
IconURL = "https://github.com/favicon.ico";
|
||||
Description = "Your code yum yum";
|
||||
URLTemplate = "https://github.com/search?q={searchTerms}&type=code";
|
||||
}
|
||||
{
|
||||
Name = "Codeberg";
|
||||
Alias = "@cb";
|
||||
IconURL = "https://codeberg.org/favicon.ico";
|
||||
Description = "Software development, but free!";
|
||||
URLTemplate = "https://codeberg.org/explore/repos?q={searchTerms}";
|
||||
}
|
||||
{
|
||||
Name = "?C";
|
||||
Alias = "@cc";
|
||||
IconURL = "https://git.confusedcompiler.org/favicon.ico";
|
||||
URLTemplate = "https://git.confusedcompiler.org/explore/repos?q={searchTerms}";
|
||||
}
|
||||
|
||||
# Forges
|
||||
{
|
||||
Name = "GitHub";
|
||||
Alias = "@gh";
|
||||
IconURL = "https://github.com/favicon.ico";
|
||||
Description = "Your code yum yum";
|
||||
URLTemplate = "https://github.com/search?q={searchTerms}&type=repositories";
|
||||
}
|
||||
{
|
||||
Name = "GitHub (Code Search)";
|
||||
Alias = "@ghc";
|
||||
IconURL = "https://github.com/favicon.ico";
|
||||
Description = "Your code yum yum";
|
||||
URLTemplate = "https://github.com/search?q={searchTerms}&type=code";
|
||||
}
|
||||
{
|
||||
Name = "Codeberg";
|
||||
Alias = "@cb";
|
||||
IconURL = "https://codeberg.org/favicon.ico";
|
||||
Description = "Software development, but free!";
|
||||
URLTemplate = "https://codeberg.org/explore/repos?q={searchTerms}";
|
||||
}
|
||||
{
|
||||
Name = "?C";
|
||||
Alias = "@cc";
|
||||
IconURL = "https://git.confusedcompiler.org/favicon.ico";
|
||||
URLTemplate = "https://git.confusedcompiler.org/explore/repos?q={searchTerms}";
|
||||
}
|
||||
# Nix{,OS,pkgs}
|
||||
{
|
||||
Name = "NixOS Search (Package)";
|
||||
Alias = "@np";
|
||||
IconURL = "https://nixos.org/favicon.ico";
|
||||
Description = "Search in nixpkgs";
|
||||
URLTemplate = "https://search.nixos.org/packages?query={searchTerms}";
|
||||
}
|
||||
{
|
||||
Name = "NixOS Search (Options)";
|
||||
Alias = "@no";
|
||||
IconURL = "https://nixos.org/favicon.ico";
|
||||
Description = "Search in NixOS options";
|
||||
URLTemplate = "https://search.nixos.org/options?query={searchTerms}";
|
||||
}
|
||||
|
||||
# Nix{,OS,pkgs}
|
||||
{
|
||||
Name = "NixOS Search (Package)";
|
||||
Alias = "@np";
|
||||
IconURL = "https://nixos.org/favicon.ico";
|
||||
Description = "Search in nixpkgs";
|
||||
URLTemplate = "https://search.nixos.org/packages?query={searchTerms}";
|
||||
}
|
||||
{
|
||||
Name = "NixOS Search (Options)";
|
||||
Alias = "@no";
|
||||
IconURL = "https://nixos.org/favicon.ico";
|
||||
Description = "Search in NixOS options";
|
||||
URLTemplate = "https://search.nixos.org/options?query={searchTerms}";
|
||||
}
|
||||
# Haskell
|
||||
{
|
||||
Name = "Flora";
|
||||
Alias = "@hs";
|
||||
IconURL = "https://flora.pm/static/icons/favicon-32x32.png";
|
||||
URLTemplate = "https://flora.pm/search?q={searchTerms}";
|
||||
}
|
||||
|
||||
# Haskell
|
||||
{
|
||||
Name = "Flora";
|
||||
Alias = "@hs";
|
||||
IconURL = "https://flora.pm/static/icons/favicon-32x32.png";
|
||||
URLTemplate = "https://flora.pm/search?q={searchTerms}";
|
||||
}
|
||||
# Discourse
|
||||
{
|
||||
Name = "NixOS Discourse";
|
||||
Alias = "@nd";
|
||||
IconURL = "https://nixos.org/favicon.ico";
|
||||
URLTemplate = "https://discourse.nixos.org/search?q={searchTerms}";
|
||||
}
|
||||
{
|
||||
Name = "Framework Discourse";
|
||||
Alias = "@fd";
|
||||
IconURL = "https://frame.work/favicon.ico";
|
||||
URLTemplate = "https://community.frame.work/search?q={searchTerms}";
|
||||
}
|
||||
|
||||
# Discourse
|
||||
{
|
||||
Name = "NixOS Discourse";
|
||||
Alias = "@nd";
|
||||
IconURL = "https://nixos.org/favicon.ico";
|
||||
URLTemplate = "https://discourse.nixos.org/search?q={searchTerms}";
|
||||
}
|
||||
{
|
||||
Name = "Framework Discourse";
|
||||
Alias = "@fd";
|
||||
IconURL = "https://frame.work/favicon.ico";
|
||||
URLTemplate = "https://community.frame.work/search?q={searchTerms}";
|
||||
}
|
||||
|
||||
# Misc
|
||||
{
|
||||
Name = "YouTube";
|
||||
Alias = "@yt";
|
||||
IconURL = "https://youtube.com/favicon.ico";
|
||||
SuggestURLTemplate = "http://suggestqueries.google.com/complete/search?q={searchTerms}&ds=yt";
|
||||
URLTemplate = "https://www.youtube.com/results?search_query={searchTerms}";
|
||||
}
|
||||
{
|
||||
Name = "Genius";
|
||||
Alias = "@geni";
|
||||
IconURL = "https://genius.com/favicon.ico";
|
||||
URLTemplate = "https://genius.com/search?q={searchTerms}";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
# Misc
|
||||
{
|
||||
Name = "YouTube";
|
||||
Alias = "@yt";
|
||||
IconURL = "https://youtube.com/favicon.ico";
|
||||
SuggestURLTemplate = "http://suggestqueries.google.com/complete/search?q={searchTerms}&ds=yt";
|
||||
URLTemplate = "https://www.youtube.com/results?search_query={searchTerms}";
|
||||
}
|
||||
{
|
||||
Name = "Genius";
|
||||
Alias = "@geni";
|
||||
IconURL = "https://genius.com/favicon.ico";
|
||||
URLTemplate = "https://genius.com/search?q={searchTerms}";
|
||||
}
|
||||
];
|
||||
|
||||
profiles = {
|
||||
default = {
|
||||
|
|
@ -120,26 +108,29 @@ in {
|
|||
font-family: monospace;
|
||||
}
|
||||
'';
|
||||
extensions.packages = let
|
||||
addons = nur.repos.rycee.firefox-addons;
|
||||
in [
|
||||
addons.sponsorblock
|
||||
addons.return-youtube-dislikes
|
||||
addons.consent-o-matic
|
||||
];
|
||||
extensions.packages =
|
||||
let
|
||||
addons = nur.repos.rycee.firefox-addons;
|
||||
in
|
||||
[
|
||||
addons.sponsorblock
|
||||
addons.return-youtube-dislikes
|
||||
addons.consent-o-matic
|
||||
];
|
||||
};
|
||||
|
||||
junk = {
|
||||
id = 1;
|
||||
inherit
|
||||
(config.programs.firefox.profiles.default)
|
||||
inherit (config.programs.firefox.profiles.default)
|
||||
settings
|
||||
userChrome
|
||||
;
|
||||
|
||||
extensions.packages = let
|
||||
addons = nur.repos.rycee.firefox-addons;
|
||||
in [addons.multi-account-containers];
|
||||
extensions.packages =
|
||||
let
|
||||
addons = nur.repos.rycee.firefox-addons;
|
||||
in
|
||||
[ addons.multi-account-containers ];
|
||||
|
||||
containers = {
|
||||
raisin = {
|
||||
|
|
@ -158,15 +149,16 @@ in {
|
|||
# Isolate it because it's proprietary
|
||||
tampermonkey = {
|
||||
id = 2;
|
||||
inherit
|
||||
(config.programs.firefox.profiles.default)
|
||||
inherit (config.programs.firefox.profiles.default)
|
||||
settings
|
||||
userChrome
|
||||
;
|
||||
|
||||
extensions.packages = let
|
||||
addons = nur.repos.rycee.firefox-addons;
|
||||
in [addons.tampermonkey];
|
||||
extensions.packages =
|
||||
let
|
||||
addons = nur.repos.rycee.firefox-addons;
|
||||
in
|
||||
[ addons.tampermonkey ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
38
nix/configurations/vanadium/home/gtk.nix
Normal file
38
nix/configurations/vanadium/home/gtk.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [
|
||||
pkgs.pantheon.elementary-sound-theme
|
||||
];
|
||||
|
||||
# Note: this would automatically recurse into gtk{2,3,4} settings
|
||||
# In version prior to 25.11 it doesn't do this.
|
||||
gtk.enable = true;
|
||||
gtk = {
|
||||
font = {
|
||||
name = "Ubuntu";
|
||||
package = pkgs.ubuntu-classic;
|
||||
};
|
||||
iconTheme = {
|
||||
name = "Adwaita";
|
||||
package = pkgs.gnome-themes-extra;
|
||||
};
|
||||
theme = {
|
||||
name = "Adwaita";
|
||||
package = pkgs.gnome-themes-extra;
|
||||
};
|
||||
|
||||
# TODO: open an issue, why are the types inconsistent? ew.
|
||||
gtk2.extraConfig = ''
|
||||
gtk-sound-theme-name = "elementary"
|
||||
'';
|
||||
gtk3.extraConfig = {
|
||||
gtk-sound-theme-name = "elementary";
|
||||
};
|
||||
gtk4.extraConfig = {
|
||||
gtk-sound-theme-name = "elementary";
|
||||
};
|
||||
};
|
||||
dconf.settings = {
|
||||
"org/gnome/desktop/sound".theme-name = "elementary";
|
||||
};
|
||||
}
|
||||
|
|
@ -1,19 +1,21 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
nixosConfig ? {},
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
#
|
||||
# fonts
|
||||
#
|
||||
fonts.fontconfig = {
|
||||
enable = true;
|
||||
defaultFonts = lib.mapAttrsRecursive (_: v: v ++ ["Last Resort"]) {
|
||||
sansSerif = ["Ubuntu" "Noto Sans CJK TC"];
|
||||
serif = ["Noto Serif CJK TC"];
|
||||
monospace = ["Iosevka"];
|
||||
emoji = ["Noto Color Emoji"];
|
||||
defaultFonts = {
|
||||
sansSerif = [
|
||||
"Ubuntu"
|
||||
"Noto Sans CJK TC"
|
||||
];
|
||||
serif = [ "Noto Serif CJK TC" ];
|
||||
monospace = [ "Iosevka" ];
|
||||
emoji = [ "Noto Color Emoji" ];
|
||||
};
|
||||
};
|
||||
home.packages = [
|
||||
|
|
@ -25,12 +27,11 @@
|
|||
pkgs.noto-fonts-emoji-blob-bin
|
||||
pkgs.ubuntu-classic
|
||||
pkgs.iosevka
|
||||
pkgs.last-resort
|
||||
];
|
||||
|
||||
home.file = {
|
||||
".xscreensaver".source = "${./xscreensaver/.xscreensaver}";
|
||||
".wallpaper".source = "${pkgs.wallpapers.y-combinator}/main.svg";
|
||||
".wallpaper".source = "${pkgs.wallpapers.packages.serial_experiments_lain.lain_red_bg}";
|
||||
};
|
||||
xdg.configFile = {
|
||||
"xmonad".source = "${./xmonad}";
|
||||
|
|
@ -38,13 +39,9 @@
|
|||
home.pointerCursor = {
|
||||
x11.enable = true;
|
||||
gtk.enable = true;
|
||||
|
||||
inherit
|
||||
(nixosConfig.services.xserver.displayManager.lightdm.greeters.gtk.cursorTheme)
|
||||
name
|
||||
package
|
||||
size
|
||||
;
|
||||
name = "Posy_Cursor_Black";
|
||||
package = pkgs.posy-cursors;
|
||||
size = 72;
|
||||
};
|
||||
xresources.properties."Xft.dpi" = 150;
|
||||
i18n.inputMethod = {
|
||||
|
|
@ -52,10 +49,15 @@
|
|||
type = "fcitx5";
|
||||
};
|
||||
|
||||
xdg.mimeApps = {
|
||||
enable = true;
|
||||
defaultApplications = {
|
||||
"x-scheme-handler/mailto" = ["org.gnome.Evolution.desktop"];
|
||||
xdg.mimeApps =
|
||||
let
|
||||
associations = {
|
||||
"x-scheme-handler/mailto" = [ "org.gnome.Evolution.desktop" ];
|
||||
};
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
associations.added = associations;
|
||||
defaultApplications = associations;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,16 +3,19 @@
|
|||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
home.sessionPath = [
|
||||
"${config.home.homeDirectory}/.local/bin"
|
||||
];
|
||||
|
||||
home.sessionVariables = let
|
||||
fishCfg = config.programs.fish;
|
||||
in {
|
||||
"SHELL" = lib.mkIf fishCfg.enable (lib.getExe fishCfg.package);
|
||||
};
|
||||
home.sessionVariables =
|
||||
let
|
||||
fishCfg = config.programs.fish;
|
||||
in
|
||||
{
|
||||
"SHELL" = lib.mkIf fishCfg.enable (lib.getExe fishCfg.package);
|
||||
};
|
||||
|
||||
home.packages = [
|
||||
pkgs.ghc # my favorite calculator
|
||||
|
|
@ -37,9 +40,7 @@
|
|||
# lol
|
||||
pkgs.macchanger
|
||||
|
||||
/*
|
||||
The file picker is not ergonomic enough, sadly
|
||||
*/
|
||||
# The file picker is not ergonomic enough, sadly
|
||||
# pkgs.helix
|
||||
# pkgs.nushell
|
||||
|
||||
|
|
@ -49,7 +50,7 @@
|
|||
pkgs.zbar
|
||||
|
||||
# pdf
|
||||
pkgs.poppler_utils # pdfseparate, pdfunite
|
||||
pkgs.poppler-utils # pdfseparate, pdfunite
|
||||
pkgs.easyscan
|
||||
|
||||
# fun
|
||||
|
|
@ -61,7 +62,7 @@
|
|||
# pkgs.necrolib
|
||||
|
||||
# pretty tui tools
|
||||
pkgs.du-dust
|
||||
pkgs.dust
|
||||
pkgs.tokei
|
||||
pkgs.hyperfine
|
||||
pkgs.watchexec
|
||||
|
|
@ -69,7 +70,10 @@
|
|||
pkgs.just
|
||||
|
||||
# nix tools
|
||||
pkgs.alejandra
|
||||
# # Alejandra handles inline comments poorly
|
||||
# # https://github.com/kamadorueda/alejandra/issues/429
|
||||
# pkgs.alejandra
|
||||
pkgs.nixfmt-rfc-style
|
||||
pkgs.nurl
|
||||
pkgs.dix
|
||||
pkgs.niv
|
||||
|
|
@ -98,6 +102,7 @@
|
|||
pkgs.mousai
|
||||
pkgs.localsend # file share with iOS
|
||||
pkgs.minder # mindmap tool
|
||||
pkgs.mkvtoolnix
|
||||
|
||||
# social
|
||||
pkgs.iamb
|
||||
|
|
@ -105,6 +110,7 @@
|
|||
pkgs.signal-desktop
|
||||
pkgs.tuba # mastodon GUI client
|
||||
pkgs.emoji-picker-rs
|
||||
pkgs.telegram-desktop # for archlinux china
|
||||
|
||||
# wm utilities
|
||||
pkgs.xbrightness
|
||||
|
|
@ -117,6 +123,8 @@
|
|||
# audio utilities
|
||||
pkgs.helvum
|
||||
pkgs.pavucontrol
|
||||
pkgs.pulseaudio # pactl value control
|
||||
pkgs.pantheon.elementary-sound-theme
|
||||
];
|
||||
|
||||
programs = {
|
||||
|
|
@ -156,7 +164,12 @@
|
|||
kitty = {
|
||||
enable = true;
|
||||
font.size = 12; # sweet spot for framework 13
|
||||
settings.shell = lib.getExe config.programs.fish.package;
|
||||
settings = {
|
||||
shell = lib.getExe config.programs.fish.package;
|
||||
# https://github.com/kovidgoyal/kitty/issues/1866
|
||||
# https://sw.kovidgoyal.net/kitty/conf/#terminal-bell
|
||||
linux_bell_theme = "elementary";
|
||||
};
|
||||
};
|
||||
|
||||
chromium.enable = true;
|
||||
|
|
@ -169,7 +182,7 @@
|
|||
|
||||
gnome-keyring = {
|
||||
enable = true;
|
||||
components = ["secrets"];
|
||||
components = [ "secrets" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,32 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = let
|
||||
inherit (pkgs) lib;
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages =
|
||||
let
|
||||
inherit (pkgs) lib;
|
||||
|
||||
ghc = pkgs.haskellPackages.ghc.withPackages (haskellPackages: [
|
||||
haskellPackages.xmobar
|
||||
]);
|
||||
ghc = pkgs.haskellPackages.ghc.withPackages (haskellPackages: [
|
||||
haskellPackages.xmobar
|
||||
]);
|
||||
|
||||
wrapped-xmobar = pkgs.symlinkJoin {
|
||||
name = "xmobar";
|
||||
paths = [pkgs.xmobar];
|
||||
buildInputs = [pkgs.makeWrapper];
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/xmobar \
|
||||
--prefix PATH : "${lib.makeBinPath [ghc pkgs.libnotify]}"
|
||||
'';
|
||||
};
|
||||
in [
|
||||
wrapped-xmobar
|
||||
];
|
||||
wrapped-xmobar = pkgs.symlinkJoin {
|
||||
name = "xmobar";
|
||||
paths = [ pkgs.xmobar ];
|
||||
buildInputs = [ pkgs.makeWrapper ];
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/xmobar \
|
||||
--prefix PATH : "${
|
||||
lib.makeBinPath [
|
||||
ghc
|
||||
pkgs.libnotify
|
||||
pkgs.hrt-time
|
||||
]
|
||||
}"
|
||||
'';
|
||||
};
|
||||
in
|
||||
[
|
||||
wrapped-xmobar
|
||||
];
|
||||
|
||||
xdg.configFile = {
|
||||
"xmobar" = {
|
||||
|
|
|
|||
|
|
@ -61,12 +61,7 @@ config =
|
|||
, textOffset = 2
|
||||
|
||||
, commands =
|
||||
[ Run $ DateZone "%a %d %H:%M:%S" "" "" "hereClock" (1 &second)
|
||||
, Run $ DateZone "%H:%M" "" "America/Aruba" "arubaClock" (10 &second)
|
||||
, Run $ DateZone "%H:%M" "" "Europe/Dublin" "dublinClock" (10 &second)
|
||||
, Run $ DateZone "%H:%M" "" "America/New_York" "newYorkClock" (10 &second)
|
||||
, Run $ DateZone "%H:%M" "" "Europe/Paris" "cetClock" (10 &second)
|
||||
, Run $ DateZone "%H:%M" "" "Asia/Taipei" "tstClock" (10 &second)
|
||||
[ Run $ DateZone "%a %d %H:%M:%S" "" "" "hereClock" (1 &second)
|
||||
, Run $
|
||||
Com
|
||||
"tomorrow"
|
||||
|
|
@ -76,9 +71,13 @@ config =
|
|||
, "--target", "2025-09-16=snip snip"
|
||||
, "--target", "2025-10-13=no teef"
|
||||
, "--target", "2025-10-31=dragon book"
|
||||
, "--target", "2025-11-19=scalpel"
|
||||
, "--target", "2025-11-29=à deux"
|
||||
, "--target", "2025-12-16=dragon book²"
|
||||
, "--target", "2025-12-16=dragon book"
|
||||
, "--target", "2025-12-30=seule"
|
||||
, "--target", "2025-12-15=campus baguette"
|
||||
, "--target", "2026-02-02=monmaster"
|
||||
, "--target", "2026-02-22=dernier appel"
|
||||
]
|
||||
""
|
||||
(60 &minute)
|
||||
|
|
@ -102,6 +101,7 @@ config =
|
|||
]
|
||||
(6 &second)
|
||||
, Run $ Com "powerprofilesctl" ["get"] "" (6 &second)
|
||||
, Run $ Com "hrt-time" ["days"] "" (60 &minute)
|
||||
, Run XMonadLog
|
||||
, Run $
|
||||
Weather
|
||||
|
|
@ -122,17 +122,9 @@ config =
|
|||
" %XMonadLog% "
|
||||
<> alignSep config
|
||||
<> intercalate "|"
|
||||
[ (unwords . map greyFg)
|
||||
[ "[AUA: %arubaClock%]"
|
||||
, "[DUB: %dublinClock%]"
|
||||
, "[JFK: %newYorkClock%]"
|
||||
, "[CDG: %cetClock%]"
|
||||
, "[TPE: %tstClock%]"
|
||||
]
|
||||
<> " "
|
||||
, " %RCSS% "
|
||||
[ " %RCSS% "
|
||||
, " %battery%, %powerprofilesctl%) "
|
||||
, " %hereClock% (%tomorrow%) "
|
||||
, " %hereClock% (%tomorrow%, %hrt-time%) "
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,14 +18,14 @@ common common
|
|||
, xmonad-contrib
|
||||
, containers
|
||||
, X11
|
||||
default-language: GHC2021
|
||||
default-language: Haskell2010
|
||||
|
||||
library
|
||||
import: common
|
||||
hs-source-dirs: lib
|
||||
exposed-modules:
|
||||
Leanamonad.Layouts.ReflectMsg
|
||||
Leanamonad.GreekChar
|
||||
XMonad.Layout.Reflect.Message
|
||||
Data.Char.Greek
|
||||
|
||||
executable leanamonad
|
||||
import: common
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
module Leanamonad.GreekChar where
|
||||
module Data.Char.Greek where
|
||||
|
||||
import Data.List (find)
|
||||
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
{-# LANGUAGE NegativeLiterals #-}
|
||||
{-# LANGUAGE FlexibleInstances #-}
|
||||
{-# LANGUAGE MultiParamTypeClasses #-}
|
||||
|
||||
module Leanamonad.Layouts.ReflectMsg where
|
||||
module XMonad.Layout.Reflect.Message where
|
||||
|
||||
import XMonad (
|
||||
Resize (Expand, Shrink),
|
||||
|
|
@ -1,45 +1,53 @@
|
|||
{-# LANGUAGE NegativeLiterals #-}
|
||||
{-# LANGUAGE LambdaCase #-}
|
||||
{-# OPTIONS_GHC -Wno-missing-signatures #-} -- my layout is getting crazy
|
||||
|
||||
import XMonad
|
||||
import XMonad.Actions.CopyWindow
|
||||
import XMonad.Actions.PerWorkspaceKeys
|
||||
import XMonad.Actions.Submap
|
||||
import XMonad.Actions.SwapWorkspaces
|
||||
import XMonad.Hooks.DynamicLog
|
||||
import XMonad.Hooks.EwmhDesktops
|
||||
import XMonad.Hooks.FadeWindows
|
||||
import XMonad.Hooks.InsertPosition
|
||||
import XMonad.Hooks.ManageDocks
|
||||
import XMonad.Hooks.ManageHelpers
|
||||
import XMonad.Hooks.OnPropertyChange
|
||||
import XMonad.Hooks.RefocusLast
|
||||
import XMonad.Hooks.StatusBar
|
||||
import XMonad.Layout.Accordion
|
||||
import XMonad.Layout.Grid
|
||||
import XMonad.Layout.IfMax
|
||||
import XMonad.Layout.LimitWindows
|
||||
import XMonad.Layout.Maximize
|
||||
import XMonad.Layout.NoBorders
|
||||
import XMonad.Layout.Reflect
|
||||
import XMonad.Layout.PerWorkspace
|
||||
import XMonad.Layout.Renamed
|
||||
import XMonad.Layout.ResizableTile
|
||||
import XMonad.Layout.Spacing
|
||||
import XMonad.StackSet qualified as W
|
||||
import XMonad.Layout.ThreeColumns
|
||||
import XMonad.Layout.ToggleLayouts
|
||||
import qualified XMonad.StackSet as W
|
||||
import XMonad.Util.EZConfig
|
||||
import XMonad.Util.Hacks
|
||||
import XMonad.Util.NamedScratchpad
|
||||
import XMonad.Util.SpawnOnce
|
||||
import XMonad.Layout.Magnifier
|
||||
|
||||
import Data.Map.Strict qualified as M
|
||||
import Data.Monoid
|
||||
import Data.Char.Greek
|
||||
import Data.Ratio
|
||||
import Data.Semigroup
|
||||
import qualified Data.Map.Strict as M
|
||||
import System.Posix
|
||||
import Graphics.X11.ExtraTypes.XF86
|
||||
|
||||
import Leanamonad.Layouts.ReflectMsg
|
||||
import Leanamonad.GreekChar
|
||||
|
||||
main :: IO ()
|
||||
main =
|
||||
xmonad
|
||||
-- Fix all java things that don't scale with XMonad
|
||||
-- https://wiki.archlinux.org/title/java#Gray_window,_applications_not_resizing_with_WM,_menus_immediately_closing
|
||||
. javaHack
|
||||
. withSB xmobarConfig . docks
|
||||
. ewmhFullscreen . ewmh
|
||||
$ javaHack
|
||||
$ withSB xmobarConfig . docks
|
||||
$ setEwmhActivateHook myActivateHook
|
||||
$ ewmhFullscreen . ewmh
|
||||
$ def
|
||||
{ modMask = superMask
|
||||
, borderWidth = 5
|
||||
|
|
@ -48,208 +56,306 @@ main =
|
|||
, focusFollowsMouse = True
|
||||
, terminal = myTerm
|
||||
, workspaces = myWorkspaces
|
||||
|
||||
, logHook =
|
||||
let
|
||||
fadeHook =
|
||||
composeOne
|
||||
[ -- easier to paint over stuff
|
||||
isFloating
|
||||
<&&> isFocused
|
||||
<&&> title ~? "Wplace"
|
||||
-?> transparency 0.5
|
||||
|
||||
-- matches the second string of the WM_CLASS
|
||||
, className `isOneOf`
|
||||
[ "firefox"
|
||||
, "Signal"
|
||||
, "steam"
|
||||
, "discord"
|
||||
]
|
||||
-?> opaque
|
||||
|
||||
, isFloating -?> ifM isFocused (transparency 0.04) (transparency 0.08)
|
||||
, isUnfocused -?> transparency 0.02
|
||||
]
|
||||
in
|
||||
fadeWindowsLogHook fadeHook
|
||||
<> refocusLastLogHook
|
||||
|
||||
, startupHook = do
|
||||
spawnOnce "fcitx5 &" -- Input method
|
||||
|
||||
spawn "feh --no-fehbg --bg-fill ~/.wallpaper &" -- wallpaper
|
||||
|
||||
-- Needed to make gnome keyring work
|
||||
-- https://wiki.archlinux.org/title/GNOME/Keyring#Using_gnome-keyring-daemon_outside_desktop_environments_(KDE,_GNOME,_XFCE,_...)
|
||||
spawn "dbus-update-activation-environment DISPLAY XAUTHORITY WAYLAND_DISPLAY"
|
||||
|
||||
io $ do
|
||||
-- This is done here because:
|
||||
-- - setting `home.sessionVariable` (home-manager) would only effect shells, probably due to the order of launched processes blah blah
|
||||
-- - setting `environment.sessionVariables` (NixOS) would make my set up less portable
|
||||
putEnv "GLFW_IM_MODULE=ibus" -- Make sure kitty knows how to talk to fcitx
|
||||
putEnv "MOZ_USE_XINPUT2=1" -- Force touchpad for firefox
|
||||
|
||||
, layoutHook =
|
||||
let tallr = named "Normal"
|
||||
$ smartSpacingWithEdge 5
|
||||
$ reflectMsg . reflectHoriz
|
||||
$ ResizableTall 1 (1/10) (3/7) []
|
||||
mag = magnifyxy 1.05 1.3 (NoMaster 3) False
|
||||
in avoidStruts . smartBorders $
|
||||
mag tallr ||| Full
|
||||
|
||||
, manageHook =
|
||||
let
|
||||
hasEvenWindows :: X Bool
|
||||
hasEvenWindows = g <$> get
|
||||
where g = even . length . W.integrate'
|
||||
. W.stack . W.workspace . W.current . windowset
|
||||
|
||||
-- When having a lot of windows this will converge into the middle of the stack
|
||||
insertInMiddle :: Query (Endo WindowSet)
|
||||
insertInMiddle =
|
||||
ifM
|
||||
(liftX hasEvenWindows)
|
||||
(insertPosition Below Newer) -- New window is odd
|
||||
(insertPosition Above Newer) -- New window is even
|
||||
in
|
||||
composeAll
|
||||
[ className ~? "NautilusPreviewer" --> customFloating centeredFloat
|
||||
, className =? "feh" --> customFloating buttomRightFloat
|
||||
, className =? "Minder"
|
||||
<&&> not <$> title ~? "Pick a Color" -- ignore the color picker
|
||||
--> customFloating centeredFloat
|
||||
, isFirefoxPIP --> doFloat
|
||||
|
||||
, namedScratchpadManageHook myScratchpads
|
||||
]
|
||||
|
||||
<>
|
||||
composeOne
|
||||
[ className =? "firefox" -?> insertPosition Master Newer
|
||||
, className =? "kitty" -?> insertPosition Below Newer
|
||||
, className `isOneOf`
|
||||
[ "sioyek"
|
||||
, "Nautilus"
|
||||
]
|
||||
-?> insertPosition End Older
|
||||
, Just <$> insertInMiddle
|
||||
]
|
||||
, logHook = refocusLastLogHook
|
||||
, startupHook = myStartupHook
|
||||
, layoutHook = myLayout
|
||||
, manageHook = myManageHook
|
||||
, handleEventHook = myEventHandleHook
|
||||
}
|
||||
|
||||
-- Only remove mappings that needs pass through (it's a map).
|
||||
`removeKeys`
|
||||
[ (superMask, xK_h)
|
||||
, (superMask, xK_l)
|
||||
, (superMask, xK_p)
|
||||
-- Only remove mappings that needs pass through
|
||||
`removeKeys` removedKeybinds
|
||||
`additionalKeys` keybinds
|
||||
|
||||
-- It has been more than once that I actidently killed xmonad >:(
|
||||
, (superMask .|. shiftMask, xK_q)
|
||||
]
|
||||
++ [ (superMask , n) | n <- [xK_1 .. xK_9] ]
|
||||
++ [ (superMask .|. shiftMask, n) | n <- [xK_1 .. xK_9] ]
|
||||
myLayout =
|
||||
avoidStruts
|
||||
$ smartBorders
|
||||
$ onWorkspace chatWS (ifMaxToggle 2 grid accordion)
|
||||
$ onWorkspace multimediaWS (ifMaxToggle 2 grid accordion)
|
||||
-- Magifier doesn't work well with threecol's slaves
|
||||
-- Full has the property of "only maximizing the focused one"
|
||||
-- Maximize can have a window maximized but not focused, might be useful when programming
|
||||
$ maximizeWithPadding 0 threecol
|
||||
where
|
||||
ifMaxToggle n tog l = ifMax n l (toggleLayouts tog l)
|
||||
threecol =
|
||||
renamed [ Replace "3Col" ]
|
||||
$ smartSpacingWithEdge 5
|
||||
$ ThreeColMid 1 (3/100) (1/2)
|
||||
|
||||
`additionalKeys`
|
||||
[
|
||||
-- Display
|
||||
((0, xF86XK_MonBrightnessDown), spawn "light -U 5")
|
||||
, ((0, xF86XK_MonBrightnessUp ), spawn "light -A 5")
|
||||
, ((shiftMask, xF86XK_MonBrightnessDown), spawn "light -U 1")
|
||||
, ((shiftMask, xF86XK_MonBrightnessUp ), spawn "light -A 1")
|
||||
, ((altMask, xF86XK_MonBrightnessUp ), spawn "autorandr --change --ignore-lid")
|
||||
, ((altMask, xF86XK_MonBrightnessDown), spawn "autorandr --change --ignore-lid")
|
||||
grid =
|
||||
renamed [ Replace "Grid" ]
|
||||
$ smartSpacingWithEdge 5
|
||||
$ Grid
|
||||
|
||||
-- Volume adjustments
|
||||
-- Don't overload the mute button
|
||||
-- In case of doubt, smashing the button becomes deterministic
|
||||
, ((0, xF86XK_AudioMute), spawn "pactl -- set-sink-mute 0 1" ) -- mute
|
||||
, ((controlMask, xF86XK_AudioMute), spawn "pactl -- set-sink-mute 0 0" ) -- unmute
|
||||
, ((0, xF86XK_AudioLowerVolume), spawn "pactl -- set-sink-volume 0 -5%")
|
||||
, ((0, xF86XK_AudioRaiseVolume), spawn "pactl -- set-sink-volume 0 +5%")
|
||||
, ((shiftMask, xF86XK_AudioLowerVolume), spawn "pactl -- set-sink-volume 0 -1%")
|
||||
, ((shiftMask, xF86XK_AudioRaiseVolume), spawn "pactl -- set-sink-volume 0 +1%")
|
||||
accordion =
|
||||
renamed [ Replace "Accordion" ]
|
||||
$ smartSpacingWithEdge 5
|
||||
$ limitSlice 3
|
||||
$ Accordion
|
||||
|
||||
-- Playback control
|
||||
, ((0, xF86XK_AudioPrev), spawn "playerctl previous" )
|
||||
, ((0, xF86XK_AudioPlay), spawn "playerctl play-pause")
|
||||
, ((0, xF86XK_AudioNext), spawn "playerctl next" )
|
||||
isSioyek :: Query Bool
|
||||
isSioyek = className =? "sioyek"
|
||||
|
||||
-- Toggle fullscreen
|
||||
, ((superMask, xK_Escape), sendMessage NextLayout)
|
||||
isDiscord :: Query Bool
|
||||
isDiscord =
|
||||
let electronDiscord = className =? "discord"
|
||||
firefoxDiscord = isFirefox <&&> title ~? "Discord"
|
||||
in electronDiscord <||> firefoxDiscord
|
||||
|
||||
-- Resize windows
|
||||
, ((superMask, xK_equal ), sendMessage $ IncMasterN 1)
|
||||
, ((superMask, xK_minus ), sendMessage $ IncMasterN -1)
|
||||
, ((superMask, xK_comma ), sendMessage Shrink )
|
||||
, ((superMask, xK_period ), sendMessage Expand )
|
||||
, ((superMask .|. shiftMask, xK_comma ), sendMessage MirrorShrink )
|
||||
, ((superMask .|. shiftMask, xK_period), sendMessage MirrorExpand )
|
||||
, ((superMask , xK_apostrophe), sendMessage Toggle )
|
||||
isEvolution :: Query Bool
|
||||
isEvolution = className ~? "gnome.Evolution"
|
||||
|
||||
-- [D]o sink and lift
|
||||
, ( (superMask, xK_d)
|
||||
, submap $ M.fromList
|
||||
[ ((0, xK_t), withFocused $ windows . W.sink)
|
||||
, ((0, xK_l), withFocused $ windows . flip W.float centeredFloat)
|
||||
]
|
||||
)
|
||||
isEvolutionComposer :: Query Bool
|
||||
isEvolutionComposer =
|
||||
isEvolution <&&>
|
||||
(fmap or . sequence)
|
||||
[ title =? "Compose Message"
|
||||
, title ^? "Re: " -- reply message composer
|
||||
, title ^? "Appointment" -- calendar event editor
|
||||
, title ^? "Meeting" -- calendar event editor
|
||||
]
|
||||
|
||||
-- Screenshots
|
||||
++ (let
|
||||
fullscreen = "maim -u | xclip -in -selection clipboard -t image/png"
|
||||
isFirefox :: Query Bool
|
||||
isFirefox = className =? "firefox" <||> className ^? "zen"
|
||||
|
||||
isSpotify :: Query Bool
|
||||
isSpotify = isFirefox <&&> title ~? "Spotify"
|
||||
|
||||
isYouTube :: Query Bool
|
||||
isYouTube = isFirefox <&&> title ~? "YouTube"
|
||||
|
||||
isWhatsApp :: Query Bool
|
||||
isWhatsApp = isFirefox <&&> title ~? "WhatsApp"
|
||||
|
||||
isSignal :: Query Bool
|
||||
isSignal = className =? "Signal"
|
||||
|
||||
isElement :: Query Bool
|
||||
isElement = isFirefox <&&> title ~? "Element"
|
||||
|
||||
isFirefoxPip :: Query Bool
|
||||
isFirefoxPip =
|
||||
isFirefox
|
||||
-- This changes depending on the locale of the browser :/
|
||||
<&&> (title =? "Incrustation vidéo" <||> title =? "Picture-in-Picture")
|
||||
|
||||
isPavucontrol :: Query Bool
|
||||
isPavucontrol = className =? "pavucontrol"
|
||||
|
||||
isFeh :: Query Bool
|
||||
isFeh = className =? "feh"
|
||||
|
||||
isNautilus :: Query Bool
|
||||
isNautilus = className $? "Nautilus"
|
||||
|
||||
isNautilusPreviewer :: Query Bool
|
||||
isNautilusPreviewer = className $? "NautilusPreviewer"
|
||||
|
||||
isMinder :: Query Bool
|
||||
isMinder = className =? "Minder" <&&> (not <$> title ~? "Pick a Color")
|
||||
|
||||
isKitty :: Query Bool
|
||||
isKitty = className =? "kitty"
|
||||
|
||||
isUtility :: Query Bool
|
||||
isUtility =
|
||||
-- Useful to ignore stuff like digikam pop ups
|
||||
isInProperty "_NET_WM_WINDOW_TYPE" "_NET_WM_WINDOW_TYPE_UTILITY"
|
||||
|
||||
myActivateHook :: ManageHook
|
||||
myActivateHook =
|
||||
-- Ignore activate request
|
||||
composeOne
|
||||
[ isDiscord -?> mempty
|
||||
, isEvolution -?> mempty
|
||||
, isSignal -?> mempty
|
||||
, isSioyek -?> mempty
|
||||
, isFeh -?> mempty
|
||||
, return True -?> doFocus
|
||||
]
|
||||
|
||||
myManageHook :: ManageHook
|
||||
myManageHook =
|
||||
composeAll
|
||||
[ isNautilusPreviewer --> customFloating centeredFloat
|
||||
, isPavucontrol --> customFloating centeredFloat
|
||||
, isFeh --> doF copyToAll <> customFloating buttomRightFloat
|
||||
, isMinder --> customFloating centeredFloat
|
||||
, isDiscord --> doShift chatWS
|
||||
, isEvolution --> doShift chatWS
|
||||
, isSignal --> doShift chatWS
|
||||
, isFirefox --> insertPosition Master Newer
|
||||
, isKitty --> insertPosition Below Newer
|
||||
, isNautilus <||> isSioyek --> insertPosition End Older
|
||||
]
|
||||
-- Note: some rules here are overlapping, the first one will take the precedence (composeOne)
|
||||
-- e.g. firefoxpip is a utility window
|
||||
<> composeOne
|
||||
[ isFirefoxPip -?> doF copyToAll <> customFloating buttomRightFloat
|
||||
, isUtility -?> doIgnore
|
||||
, isDialog -?> customFloating centeredFloat
|
||||
, isEvolutionComposer -?> customFloating centeredFloat
|
||||
]
|
||||
<> namedScratchpadManageHook myScratchpads
|
||||
|
||||
-- TODO: is there a way to always open certain sites in new windows in firefox?
|
||||
-- TODO: stop full screen when move happens
|
||||
myEventHandleHook :: Event -> X All
|
||||
myEventHandleHook =
|
||||
-- If the title changes in the background, we don't want to greedy view that workspace.
|
||||
-- Imagine Spotify playing in the background, a track change would focus that workspace.
|
||||
-- We prevent this by checking if the window is in the current workspace
|
||||
onTitleChange
|
||||
$ (windowIsInCurrentWorkspace -->)
|
||||
$ composeAll
|
||||
[ isSpotify --> doShiftAndGreedyView multimediaWS
|
||||
, isYouTube --> doShiftAndGreedyView multimediaWS
|
||||
, isDiscord --> doShiftAndGreedyView chatWS
|
||||
, isWhatsApp --> doShiftAndGreedyView chatWS
|
||||
, isElement --> doShiftAndGreedyView chatWS
|
||||
]
|
||||
|
||||
doShiftAndGreedyView :: WorkspaceId -> Query (Endo WindowSet)
|
||||
doShiftAndGreedyView n = doF . go =<< ask
|
||||
where go :: Window -> WindowSet -> WindowSet
|
||||
go w s = W.greedyView n $ W.shiftWin n w s
|
||||
|
||||
queryWindowSet :: Query WindowSet
|
||||
queryWindowSet = liftX $ gets windowset
|
||||
|
||||
windowIsInCurrentWorkspace :: Query Bool
|
||||
windowIsInCurrentWorkspace = do
|
||||
w <- ask
|
||||
s <- queryWindowSet
|
||||
pure $ case W.findTag w s of
|
||||
Just from | from == W.currentTag s -> True
|
||||
_ -> False
|
||||
|
||||
myStartupHook :: X ()
|
||||
myStartupHook = do
|
||||
spawnOnce "fcitx5 &" -- Input method
|
||||
|
||||
spawn "feh --no-fehbg --bg-fill ~/.wallpaper &" -- wallpaper
|
||||
|
||||
-- Needed to make gnome keyring work
|
||||
-- https://wiki.archlinux.org/title/GNOME/Keyring#Using_gnome-keyring-daemon_outside_desktop_environments_(KDE,_GNOME,_XFCE,_...)
|
||||
spawn "dbus-update-activation-environment DISPLAY XAUTHORITY WAYLAND_DISPLAY"
|
||||
|
||||
io $ do
|
||||
-- This is done here because:
|
||||
-- - setting `home.sessionVariable` (home-manager) would only effect shells, probably due to the order of launched processes blah blah
|
||||
-- - setting `environment.sessionVariables` (NixOS) would make my set up less portable
|
||||
putEnv "GLFW_IM_MODULE=ibus" -- Make sure kitty knows how to talk to fcitx
|
||||
putEnv "MOZ_USE_XINPUT2=1" -- Force touchpad for firefox
|
||||
|
||||
removedKeybinds :: [(KeyMask, KeySym)]
|
||||
removedKeybinds =
|
||||
[ (superMask, xK_h)
|
||||
, (superMask, xK_l)
|
||||
, (superMask, xK_p)
|
||||
|
||||
-- It has been more than once that I actidently killed xmonad >:(
|
||||
, (superMask .|. shiftMask, xK_q)
|
||||
]
|
||||
++ [ (superMask , n) | n <- [xK_1 .. xK_9] ]
|
||||
++ [ (superMask .|. shiftMask, n) | n <- [xK_1 .. xK_9] ]
|
||||
|
||||
keybinds :: [((KeyMask, KeySym), X ())]
|
||||
keybinds =
|
||||
[
|
||||
-- Display
|
||||
((0, xF86XK_MonBrightnessDown), spawn "light -U 5")
|
||||
, ((0, xF86XK_MonBrightnessUp ), spawn "light -A 5")
|
||||
, ((shiftMask, xF86XK_MonBrightnessDown), spawn "light -U 1")
|
||||
, ((shiftMask, xF86XK_MonBrightnessUp ), spawn "light -A 1")
|
||||
, ((altMask, xF86XK_MonBrightnessUp ), spawn "autorandr --change --ignore-lid")
|
||||
, ((altMask, xF86XK_MonBrightnessDown), spawn "autorandr --change --ignore-lid")
|
||||
|
||||
-- Volume adjustments
|
||||
-- Don't overload the mute button
|
||||
-- In case of doubt, smashing the button becomes deterministic
|
||||
, ((0, xF86XK_AudioMute), spawn "pactl -- set-sink-mute 0 1" ) -- mute
|
||||
, ((controlMask, xF86XK_AudioMute), spawn "pactl -- set-sink-mute 0 0" ) -- unmute
|
||||
, ((0, xF86XK_AudioLowerVolume), spawn "pactl -- set-sink-volume 0 -5%")
|
||||
, ((0, xF86XK_AudioRaiseVolume), spawn "pactl -- set-sink-volume 0 +5%")
|
||||
, ((shiftMask, xF86XK_AudioLowerVolume), spawn "pactl -- set-sink-volume 0 -1%")
|
||||
, ((shiftMask, xF86XK_AudioRaiseVolume), spawn "pactl -- set-sink-volume 0 +1%")
|
||||
|
||||
-- Playback control
|
||||
, ((0, xF86XK_AudioPrev), spawn "playerctl previous" )
|
||||
, ((0, xF86XK_AudioPlay), spawn "playerctl play-pause")
|
||||
, ((0, xF86XK_AudioNext), spawn "playerctl next" )
|
||||
|
||||
-- Resize windows
|
||||
, ((superMask, xK_equal ), sendMessage $ IncMasterN 1)
|
||||
, ((superMask, xK_minus ), sendMessage $ IncMasterN -1)
|
||||
, ((superMask, xK_comma ), sendMessage Shrink )
|
||||
, ((superMask, xK_period ), sendMessage Expand )
|
||||
, ((superMask .|. shiftMask, xK_comma ), sendMessage MirrorShrink )
|
||||
, ((superMask .|. shiftMask, xK_period), sendMessage MirrorExpand )
|
||||
, ((superMask , xK_space ), chooseAction $ \ws ->
|
||||
if ws == chatWS then sendMessage ToggleLayout
|
||||
else if ws == multimediaWS then sendMessage ToggleLayout
|
||||
else withFocused (sendMessage . maximizeRestore)
|
||||
)
|
||||
|
||||
-- [D]o sink and lift
|
||||
, ( (superMask, xK_d)
|
||||
, submap $ M.fromList
|
||||
[ ((0, xK_t), withFocused $ windows . W.sink)
|
||||
, ((0, xK_l), withFocused $ windows . flip W.float centeredFloat)
|
||||
]
|
||||
)
|
||||
]
|
||||
|
||||
-- Screenshots
|
||||
++ (let fullscreen = "maim -u | xclip -in -selection clipboard -t image/png"
|
||||
withSelection = "maim -u -s -b 5 -o | xclip -in -selection clipboard -t image/png"
|
||||
toFloat = "maim -u -s -b 5 -o | feh --auto-zoom -"
|
||||
in
|
||||
[ ((0, xK_Print), spawn fullscreen )
|
||||
, ((superMask .|. shiftMask, xK_3 ), spawn fullscreen )
|
||||
, ((superMask .|. shiftMask, xK_4 ), spawn withSelection)
|
||||
, ((superMask .|. shiftMask, xK_5 ), spawn toFloat )
|
||||
])
|
||||
in [ ((0, xK_Print), spawn fullscreen )
|
||||
, ((superMask .|. shiftMask, xK_3 ), spawn fullscreen )
|
||||
, ((superMask .|. shiftMask, xK_4 ), spawn withSelection)
|
||||
, ((superMask .|. shiftMask, xK_5 ), spawn toFloat )
|
||||
]
|
||||
)
|
||||
|
||||
-- Yeet
|
||||
++ (let
|
||||
workspaceKeys = [xK_h, xK_t, xK_n, xK_s, xK_m, xK_w, xK_v, xK_z]
|
||||
in
|
||||
[ ((superMask, k), windows $ W.greedyView space)
|
||||
| (k, space) <- zip workspaceKeys myWorkspaces
|
||||
]
|
||||
++
|
||||
[ ((superMask .|. altMask, k), windows $ W.greedyView space . W.shift space)
|
||||
| (k, space) <- zip workspaceKeys myWorkspaces
|
||||
]
|
||||
++
|
||||
[ ((superMask .|. controlMask, k), windows $ swapWithCurrent space)
|
||||
| (k, space) <- zip workspaceKeys myWorkspaces
|
||||
])
|
||||
-- Yeet
|
||||
++ (let workspaceKeys = [xK_h, xK_t, xK_n, xK_s, xK_m, xK_w, xK_v, xK_z]
|
||||
in [ ((superMask, k), windows $ W.greedyView space)
|
||||
| (k, space) <- zip workspaceKeys myWorkspaces
|
||||
]
|
||||
++ [ ((superMask .|. altMask, k), windows $ W.greedyView space . W.shift space)
|
||||
| (k, space) <- zip workspaceKeys myWorkspaces
|
||||
]
|
||||
++ [ ((superMask .|. controlMask, k), windows $ swapWithCurrent space)
|
||||
| (k, space) <- zip workspaceKeys myWorkspaces
|
||||
]
|
||||
)
|
||||
|
||||
-- Launcher
|
||||
++ (let
|
||||
launchFirefox = "if type firefox; then firefox; else firefox-esr; fi"
|
||||
-- Launcher
|
||||
++ (let launchFirefox = "zen"
|
||||
launchDmenu = "dmenu_run -i -fn \"Iosevka-14\" -nb \"#36363a\" -nf \"#e2e2e4\" -sb \"#f7f7f8\" -sf \"#36363a\" -l 10"
|
||||
lock = "xscreensaver-command -lock"
|
||||
in
|
||||
[ ((controlMask .|. altMask, xK_m), namedScratchpadAction myScratchpads "cmus" )
|
||||
, ((controlMask .|. altMask, xK_t), namedScratchpadAction myScratchpads "btop" )
|
||||
, ((controlMask .|. altMask, xK_p), namedScratchpadAction myScratchpads "pass" )
|
||||
, ((controlMask .|. altMask, xK_e), namedScratchpadAction myScratchpads "emoji-picker")
|
||||
, ((controlMask .|. altMask, xK_b), spawn launchFirefox )
|
||||
, ((superMask, xK_o), spawn launchDmenu )
|
||||
, ((superMask, xK_l), spawn lock )
|
||||
])
|
||||
in [ ((controlMask .|. altMask, xK_m), namedScratchpadAction myScratchpads "cmus" )
|
||||
, ((controlMask .|. altMask, xK_t), namedScratchpadAction myScratchpads "btop" )
|
||||
, ((controlMask .|. altMask, xK_p), namedScratchpadAction myScratchpads "pass" )
|
||||
, ((controlMask .|. altMask, xK_e), namedScratchpadAction myScratchpads "emoji-picker")
|
||||
, ((controlMask .|. altMask, xK_b), spawn launchFirefox )
|
||||
, ((superMask, xK_o), spawn launchDmenu )
|
||||
, ((superMask, xK_l), spawn lock )
|
||||
]
|
||||
)
|
||||
|
||||
++ (let
|
||||
powerprofile p = (p, spawn $ "powerprofilesctl set " ++ p)
|
||||
in
|
||||
[ ( (superMask, xK_p), visualSubmap def $ M.fromList
|
||||
[ ((0, xK_1), powerprofile "power-saver")
|
||||
, ((0, xK_2), powerprofile "balanced" )
|
||||
, ((0, xK_3), powerprofile "performance")
|
||||
]
|
||||
)
|
||||
])
|
||||
++ (let powerprofile p = (p, spawn $ "powerprofilesctl set " ++ p)
|
||||
in [ ( (superMask, xK_p), visualSubmap def $ M.fromList
|
||||
[ ((0, xK_1), powerprofile "power-saver")
|
||||
, ((0, xK_2), powerprofile "balanced" )
|
||||
, ((0, xK_3), powerprofile "performance")
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
myTerm :: String
|
||||
myTerm = "kitty"
|
||||
|
|
@ -258,53 +364,53 @@ superMask, altMask :: KeyMask
|
|||
superMask = mod4Mask
|
||||
altMask = mod1Mask
|
||||
|
||||
myWorkspaces :: [String]
|
||||
myWorkspaces = take 8 . fmap (:[]) $ greekLower
|
||||
myWorkspaces :: [WorkspaceId]
|
||||
myWorkspaces = map (:[]) $ take 8 greekLower
|
||||
|
||||
chatWS :: WorkspaceId
|
||||
chatWS = myWorkspaces !! 3
|
||||
|
||||
multimediaWS :: WorkspaceId
|
||||
multimediaWS = myWorkspaces !! 6
|
||||
|
||||
centeredFloat, smallFloat, fullFloat, buttomRightFloat :: W.RationalRect
|
||||
centeredFloat = W.RationalRect (1/9) (1/9) (7/9) (7/9)
|
||||
smallFloat = W.RationalRect (3/5) (3/5) (2/7) (2/7)
|
||||
fullFloat = W.RationalRect 0 0 1 1
|
||||
buttomRightFloat = W.RationalRect (1/2) (1/2) (1/2) (1/2)
|
||||
centeredFloat = W.RationalRect (1%9) (1%9) (7%9) (7%9)
|
||||
smallFloat = W.RationalRect (3%5) (3%5) (2%7) (2%7)
|
||||
fullFloat = W.RationalRect 0 0 1 1
|
||||
buttomRightFloat = W.RationalRect (1%2) (1%2) (1%2) (1%2)
|
||||
|
||||
xmobarConfig :: StatusBarConfig
|
||||
xmobarConfig = statusBarProp "xmobar -x 0" (pure myPrettyPrinter)
|
||||
where
|
||||
myPrettyPrinter :: PP
|
||||
myPrettyPrinter =
|
||||
filterOutWsPP [scratchpadWorkspaceTag]
|
||||
$ def
|
||||
{ ppCurrent = xmobarColor "#000000" "#ffffff" . wrap " " " " . fmap toUpper
|
||||
{ ppCurrent = xmobarColor "#000000" "#ffffff" . wrap " " " "
|
||||
, ppHiddenNoWindows = xmobarColor "#9c9c9c" "" . const "⋅"
|
||||
, ppHidden = xmobarColor "#ffffff" ""
|
||||
, ppSep = " | "
|
||||
}
|
||||
|
||||
|
||||
isOneOf :: Eq a => Query a -> [a] -> Query Bool
|
||||
isOneOf q = fmap or . traverse (q =?)
|
||||
|
||||
isFocused :: Query Bool
|
||||
isFocused = fmap not isUnfocused
|
||||
|
||||
isFirefoxPIP :: Query Bool
|
||||
isFirefoxPIP =
|
||||
className =? "firefox"
|
||||
<&&> title =? "Picture-in-Picture"
|
||||
|
||||
myScratchpads :: [NamedScratchpad]
|
||||
myScratchpads =
|
||||
[ NS "cmus"
|
||||
[ NS
|
||||
"cmus"
|
||||
(myTerm ++ " -T 'cmus' cmus")
|
||||
(title =? "cmus")
|
||||
(customFloating centeredFloat)
|
||||
, NS "btop"
|
||||
, NS
|
||||
"btop"
|
||||
(myTerm ++ " -T 'btop' btop")
|
||||
(title =? "btop")
|
||||
(customFloating fullFloat)
|
||||
, NS "pass"
|
||||
, NS
|
||||
"pass"
|
||||
(myTerm ++ " -T 'pass' -- fish -i -c 'while :; fzf-pass; end'")
|
||||
(title =? "pass")
|
||||
(customFloating smallFloat)
|
||||
, NS "emoji-picker"
|
||||
, NS
|
||||
"emoji-picker"
|
||||
(myTerm ++ " -T 'emoji-picker' -- fish -i -c 'while :; emoji-picker; end'")
|
||||
(title =? "emoji-picker")
|
||||
(customFloating smallFloat)
|
||||
|
|
|
|||
165
nix/configurations/vanadium/home/zen-browser.nix
Normal file
165
nix/configurations/vanadium/home/zen-browser.nix
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (pkgs) nur;
|
||||
in
|
||||
{
|
||||
programs.zen-browser = {
|
||||
enable = true;
|
||||
|
||||
policies.SearchEngines.Add = [
|
||||
# Forges
|
||||
{
|
||||
Name = "GitHub";
|
||||
Alias = "@gh";
|
||||
IconURL = "https://github.com/favicon.ico";
|
||||
Description = "Your code yum yum";
|
||||
URLTemplate = "https://github.com/search?q={searchTerms}&type=repositories";
|
||||
}
|
||||
{
|
||||
Name = "GitHub (Code Search)";
|
||||
Alias = "@ghc";
|
||||
IconURL = "https://github.com/favicon.ico";
|
||||
Description = "Your code yum yum";
|
||||
URLTemplate = "https://github.com/search?q={searchTerms}&type=code";
|
||||
}
|
||||
{
|
||||
Name = "Codeberg";
|
||||
Alias = "@cb";
|
||||
IconURL = "https://codeberg.org/favicon.ico";
|
||||
Description = "Software development, but free!";
|
||||
URLTemplate = "https://codeberg.org/explore/repos?q={searchTerms}";
|
||||
}
|
||||
{
|
||||
Name = "?C";
|
||||
Alias = "@cc";
|
||||
IconURL = "https://git.confusedcompiler.org/favicon.ico";
|
||||
URLTemplate = "https://git.confusedcompiler.org/explore/repos?q={searchTerms}";
|
||||
}
|
||||
|
||||
# Nix{,OS,pkgs}
|
||||
{
|
||||
Name = "NixOS Search (Package)";
|
||||
Alias = "@np";
|
||||
IconURL = "https://nixos.org/favicon.ico";
|
||||
Description = "Search in nixpkgs";
|
||||
URLTemplate = "https://search.nixos.org/packages?query={searchTerms}";
|
||||
}
|
||||
{
|
||||
Name = "NixOS Search (Options)";
|
||||
Alias = "@no";
|
||||
IconURL = "https://nixos.org/favicon.ico";
|
||||
Description = "Search in NixOS options";
|
||||
URLTemplate = "https://search.nixos.org/options?query={searchTerms}";
|
||||
}
|
||||
|
||||
# Haskell
|
||||
{
|
||||
Name = "Flora";
|
||||
Alias = "@hs";
|
||||
IconURL = "https://flora.pm/static/icons/favicon-32x32.png";
|
||||
URLTemplate = "https://flora.pm/search?q={searchTerms}";
|
||||
}
|
||||
|
||||
# Discourse
|
||||
{
|
||||
Name = "NixOS Discourse";
|
||||
Alias = "@nd";
|
||||
IconURL = "https://nixos.org/favicon.ico";
|
||||
URLTemplate = "https://discourse.nixos.org/search?q={searchTerms}";
|
||||
}
|
||||
{
|
||||
Name = "Framework Discourse";
|
||||
Alias = "@fd";
|
||||
IconURL = "https://frame.work/favicon.ico";
|
||||
URLTemplate = "https://community.frame.work/search?q={searchTerms}";
|
||||
}
|
||||
|
||||
# Misc
|
||||
{
|
||||
Name = "YouTube";
|
||||
Alias = "@yt";
|
||||
IconURL = "https://youtube.com/favicon.ico";
|
||||
SuggestURLTemplate = "http://suggestqueries.google.com/complete/search?q={searchTerms}&ds=yt";
|
||||
URLTemplate = "https://www.youtube.com/results?search_query={searchTerms}";
|
||||
}
|
||||
{
|
||||
Name = "Genius";
|
||||
Alias = "@geni";
|
||||
IconURL = "https://genius.com/favicon.ico";
|
||||
URLTemplate = "https://genius.com/search?q={searchTerms}";
|
||||
}
|
||||
];
|
||||
|
||||
profiles = {
|
||||
default = {
|
||||
settings = {
|
||||
# "full-screen-api.ignore-widgets" = true; # limit fullscreen mode to window
|
||||
};
|
||||
userChrome = ''
|
||||
/* monofont tweak */
|
||||
#statuspanel-label {
|
||||
font-family: monospace;
|
||||
}
|
||||
.urlbar-input-box {
|
||||
font-family: monospace;
|
||||
}
|
||||
'';
|
||||
extensions.packages =
|
||||
let
|
||||
addons = nur.repos.rycee.firefox-addons;
|
||||
in
|
||||
[
|
||||
addons.sponsorblock
|
||||
addons.return-youtube-dislikes
|
||||
addons.consent-o-matic
|
||||
];
|
||||
};
|
||||
|
||||
junk = {
|
||||
id = 1;
|
||||
inherit (config.programs.zen-browser.profiles.default)
|
||||
settings
|
||||
userChrome
|
||||
;
|
||||
|
||||
extensions.packages =
|
||||
let
|
||||
addons = nur.repos.rycee.firefox-addons;
|
||||
in
|
||||
[ addons.multi-account-containers ];
|
||||
|
||||
containers = {
|
||||
raisin = {
|
||||
color = "purple";
|
||||
icon = "fruit";
|
||||
id = 1;
|
||||
};
|
||||
pomme = {
|
||||
color = "red";
|
||||
icon = "fruit";
|
||||
id = 2;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Isolate it because it's proprietary
|
||||
tampermonkey = {
|
||||
id = 2;
|
||||
inherit (config.programs.zen-browser.profiles.default)
|
||||
settings
|
||||
userChrome
|
||||
;
|
||||
|
||||
extensions.packages =
|
||||
let
|
||||
addons = nur.repos.rycee.firefox-addons;
|
||||
in
|
||||
[ addons.tampermonkey ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
final: prev: let
|
||||
final: prev:
|
||||
let
|
||||
inherit (final) lib;
|
||||
in {
|
||||
in
|
||||
{
|
||||
linuxPackages = final.linuxPackagesFor (
|
||||
prev.linuxPackages.kernel.override {
|
||||
# TODO: The error message is quite unintuitive, maybe improve it?
|
||||
|
|
@ -30,18 +32,19 @@ in {
|
|||
SCHED_MC = yes;
|
||||
X86_MCE = yes;
|
||||
X86_MCE_AMD = yes;
|
||||
X86_MCE_INTEL = no;
|
||||
PERF_EVENTS_INTEL_RAPL = yes;
|
||||
X86_AMD_PSTATE = yes;
|
||||
X86_POWERNOW_K8 = no;
|
||||
|
||||
# Processor type and features > Performance monitoring
|
||||
PERF_EVENTS_AMD_POWER = yes;
|
||||
PERF_EVENTS_AMD_UNCORE = yes;
|
||||
|
||||
# With amd_pstate=active ondemand won't be available anyway.
|
||||
# Without more testing, we should accept the claim that its more power efficient and stick to it
|
||||
CPU_FREQ = yes;
|
||||
X86_INTEL_PSTATE = lib.mkForce no;
|
||||
CPU_FREQ_DEFAULT_GOV_SCHEDUTIL = lib.mkForce no;
|
||||
CPU_FREQ_DEFAULT_GOV_ONDEMAND = yes;
|
||||
# ERROR: could not insert 'amd_freq_sensitivity': No such device
|
||||
X86_AMD_FREQ_SENSITIVITY = module;
|
||||
|
||||
# skipping firmware loading section since it's handled by other parts of nixos options
|
||||
SENSORS_K10TEMP = yes;
|
||||
|
|
@ -69,6 +72,7 @@ in {
|
|||
|
||||
# Disable hypervisor guest
|
||||
HYPERVISOR_GUEST = lib.mkForce no;
|
||||
HYPERV = lib.mkForce unset;
|
||||
DRM_HYPERV = lib.mkForce unset;
|
||||
FB_HYPERV = lib.mkForce unset;
|
||||
HVC_XEN = lib.mkForce unset;
|
||||
|
|
@ -92,6 +96,10 @@ in {
|
|||
XEN_PVHVM = lib.mkForce unset;
|
||||
XEN_SAVE_RESTORE = lib.mkForce unset;
|
||||
XEN_SYS_HYPERVISOR = lib.mkForce unset;
|
||||
|
||||
# Device Driver
|
||||
MACINTOSH_DRIVERS = no; # hmm
|
||||
SURFACE_PLATFORMS = no; # ew
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -5,5 +5,5 @@
|
|||
jack.enable = true;
|
||||
};
|
||||
|
||||
me.extraGroups = ["audio"];
|
||||
me.extraGroups = [ "audio" ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,7 @@
|
|||
{
|
||||
systemd.sleep.extraConfig = ''
|
||||
HibernateDelaySec=1d
|
||||
'';
|
||||
|
||||
services.logind = {
|
||||
powerKey = "hibernate";
|
||||
lidSwitch = "suspend-then-hibernate";
|
||||
lidSwitchDocked = "ignore";
|
||||
services.logind.settings = {
|
||||
# Note: vanadium's btrfs disk layout has been changed and the swap has been reduced. It will not work with hibernate anymore.
|
||||
Login.HandleLidSwitch = "suspend";
|
||||
Login.HandleLidSwitchDocked = "ignore";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,22 +3,23 @@
|
|||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
# For nautilius and iOS
|
||||
services.gvfs.enable = true;
|
||||
# iOS
|
||||
services.usbmuxd.enable = true;
|
||||
environment.systemPackages = with pkgs; [libimobiledevice idevicerestore];
|
||||
environment.systemPackages = with pkgs; [
|
||||
libimobiledevice
|
||||
idevicerestore
|
||||
];
|
||||
|
||||
# https://unix.stackexchange.com/questions/592775/how-can-i-enable-apple-ios-fast-charge-support
|
||||
services.udev.extraRules = ''
|
||||
SUBSYSTEM=="usb", ACTION=="add", DRIVER=="apple-mfi-fastcharge", RUN+="/bin/sh -c 'echo Fast > /sys/class/power_supply/apple_mfi_fastcharge/charge_type'"
|
||||
'';
|
||||
|
||||
users.users.root.openssh.authorizedKeys.keys = let
|
||||
ids = import ../../../identities.nix;
|
||||
in
|
||||
builtins.concatMap builtins.attrValues (builtins.attrValues ids);
|
||||
users.users.root.openssh.authorizedKeys.keys = import ../../../identities.nix;
|
||||
|
||||
networking = {
|
||||
networkmanager.enable = lib.mkForce false;
|
||||
|
|
@ -37,43 +38,45 @@
|
|||
userControlled.enable = true;
|
||||
secretsFile = config.age.secrets.wpa_password.path;
|
||||
scanOnLowSignal = false;
|
||||
networks = let
|
||||
# wpa_supplicant uses `strchr` to seek to the first `=`, so the only forbidden character is `=`.
|
||||
escapePwdKey = lib.replaceStrings ["="] ["_"];
|
||||
|
||||
fromList = ns: let
|
||||
go = networkArgs @ {
|
||||
ssid,
|
||||
# Custom fields wrapping nixpkgs module options
|
||||
hasPassword ? false,
|
||||
scanOnLowSignal ? false,
|
||||
randomizeMac ? false,
|
||||
...
|
||||
}: {
|
||||
${ssid} = lib.mkMerge [
|
||||
(builtins.removeAttrs networkArgs ["ssid" "hasPassword" "scanOnLowSignal" "randomizeMac"])
|
||||
(lib.optionalAttrs hasPassword {
|
||||
pskRaw = "ext:${escapePwdKey ssid}";
|
||||
})
|
||||
(lib.optionalAttrs scanOnLowSignal {
|
||||
extraConfig = ''
|
||||
bgscan="simple:30:-70:3600"
|
||||
'';
|
||||
})
|
||||
(lib.optionalAttrs randomizeMac {
|
||||
extraConfig = ''
|
||||
mac_addr=1
|
||||
'';
|
||||
})
|
||||
];
|
||||
};
|
||||
networks =
|
||||
let
|
||||
fromList = import ../../../networks/wpa_supplicant-compat.nix;
|
||||
networks = import ../../../networks/list.nix;
|
||||
in
|
||||
lib.mkMerge (map go ns);
|
||||
in
|
||||
fromList (import ./connectivity/networks.nix);
|
||||
fromList networks;
|
||||
};
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostFiles = [
|
||||
# Prevent building up reliance on chatbots
|
||||
# Gotta preserve that thinking ability of my smoof bwain
|
||||
"${pkgs.ai_blocklist}/share/hosts.txt"
|
||||
"${pkgs.hategroup_blocklist}/share/hosts.txt"
|
||||
];
|
||||
|
||||
extraHosts = ''
|
||||
#
|
||||
# Generated from nixos configuartion
|
||||
#
|
||||
|
||||
# This is the fascist one, just block it because I can't tell
|
||||
0.0.0.0 nixos.wiki
|
||||
|
||||
# Gotta purify my smoos brain for a while
|
||||
0.0.0.0 instagram.com
|
||||
0.0.0.0 www.instagram.com
|
||||
|
||||
# The "people who you viewed can see you" thing is weird af
|
||||
0.0.0.0 linkedin.com
|
||||
0.0.0.0 www.linkedin.com
|
||||
'';
|
||||
};
|
||||
|
||||
# LAN CONNECTION
|
||||
# ~~~~~~~~~~~~~~
|
||||
# Note that when you're corrected to mullvad, you can't ssh into your local machines.
|
||||
# I wonder if there's an option to turn this off.
|
||||
services.mullvad-vpn.enable = true;
|
||||
|
||||
hardware.bluetooth.enable = true;
|
||||
|
|
|
|||
|
|
@ -2,13 +2,14 @@
|
|||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
#
|
||||
# builtin screen
|
||||
#
|
||||
{
|
||||
me.extraGroups = ["video"];
|
||||
me.extraGroups = [ "video" ];
|
||||
programs.light.enable = true;
|
||||
}
|
||||
|
||||
|
|
@ -16,10 +17,10 @@
|
|||
# external screen
|
||||
#
|
||||
{
|
||||
me.extraGroups = ["i2c"];
|
||||
me.extraGroups = [ "i2c" ];
|
||||
hardware.i2c.enable = true;
|
||||
environment.systemPackages = [pkgs.ddcutil];
|
||||
boot.kernelModules = ["i2c-dev"];
|
||||
environment.systemPackages = [ pkgs.ddcutil ];
|
||||
boot.kernelModules = [ "i2c-dev" ];
|
||||
}
|
||||
];
|
||||
|
||||
|
|
@ -33,149 +34,160 @@
|
|||
"20_xmonad" = "${lib.getExe pkgs.haskellPackages.xmonad} --restart"; # make sure feh keeps up
|
||||
};
|
||||
|
||||
profiles = let
|
||||
singleton = k: v: {${k} = v;};
|
||||
profiles =
|
||||
let
|
||||
singleton = k: v: { ${k} = v; };
|
||||
|
||||
fingerprints = {
|
||||
built-in = singleton "eDP-1" "00ffffffffffff0009e5ca0b000000002f200104a51c137803de50a3544c99260f505400000001010101010101010101010101010101115cd01881e02d50302036001dbe1000001aa749d01881e02d50302036001dbe1000001a000000fe00424f452043510a202020202020000000fe004e4531333546424d2d4e34310a0073";
|
||||
amethyst = device: singleton device "00ffffffffffff0006b35b27010101012c210103803c22782a29d5ad4f44a7240f5054bfef00714f81809500d1c0d1e8d1fc01010101565e00a0a0a029503020350055502100001a000000fd0030901edf3c000a202020202020000000fc005647323741514c33410a202020000000ff0052414c4d51533139373533370a0111020347f14a90030204014061603f1f230907078301000067030c002000384468d85dc401788003026d1a000002013090f00069096909e305ff01e6060701696900e2006ae20fc0eae70070a0a067500820980455502100001a6fc200a0a0a055503020350055502100001a5aa000a0a0a046503020350055502100001a0000bc";
|
||||
orchid = device: singleton device "00ffffffffffff0004699a24642900002416010380341d782a2ac5a4564f9e280f5054b7ef00714f814081809500b300d1c081c08100023a801871382d40582c450009252100001e000000ff0043394c4d54463031303539360a000000fd00324b185311000a202020202020000000fc00415355532056533234370a20200173020322714f0102031112130414050e0f1d1e1f10230917078301000065030c0010008c0ad08a20e02d10103e9600092521000018011d007251d01e206e28550009252100001e011d00bc52d01e20b828554009252100001e8c0ad090204031200c4055000925210000180000000000000000000000000000000000000000005d";
|
||||
};
|
||||
fingerprints = {
|
||||
built-in = singleton "eDP-1" "00ffffffffffff0009e5ca0b000000002f200104a51c137803de50a3544c99260f505400000001010101010101010101010101010101115cd01881e02d50302036001dbe1000001aa749d01881e02d50302036001dbe1000001a000000fe00424f452043510a202020202020000000fe004e4531333546424d2d4e34310a0073";
|
||||
amethyst =
|
||||
device:
|
||||
singleton device "00ffffffffffff0006b35b27010101012c210103803c22782a29d5ad4f44a7240f5054bfef00714f81809500d1c0d1e8d1fc01010101565e00a0a0a029503020350055502100001a000000fd0030901edf3c000a202020202020000000fc005647323741514c33410a202020000000ff0052414c4d51533139373533370a0111020347f14a90030204014061603f1f230907078301000067030c002000384468d85dc401788003026d1a000002013090f00069096909e305ff01e6060701696900e2006ae20fc0eae70070a0a067500820980455502100001a6fc200a0a0a055503020350055502100001a5aa000a0a0a046503020350055502100001a0000bc";
|
||||
orchid =
|
||||
device:
|
||||
singleton device "00ffffffffffff0004699a24642900002416010380341d782a2ac5a4564f9e280f5054b7ef00714f814081809500b300d1c081c08100023a801871382d40582c450009252100001e000000ff0043394c4d54463031303539360a000000fd00324b185311000a202020202020000000fc00415355532056533234370a20200173020322714f0102031112130414050e0f1d1e1f10230917078301000065030c0010008c0ad08a20e02d10103e9600092521000018011d007251d01e206e28550009252100001e011d00bc52d01e20b828554009252100001e8c0ad090204031200c4055000925210000180000000000000000000000000000000000000000005d";
|
||||
};
|
||||
|
||||
devices = rec {
|
||||
built-in = "eDP-1";
|
||||
# Run `xrandr` to see the max number
|
||||
extern = map (portNumber: "DP-${toString portNumber}") (lib.range 1 8);
|
||||
all = [built-in] ++ extern;
|
||||
};
|
||||
devices = rec {
|
||||
built-in = "eDP-1";
|
||||
# Run `xrandr` to see the max number
|
||||
extern = map (portNumber: "DP-${toString portNumber}") (lib.range 1 8);
|
||||
all = [ built-in ] ++ extern;
|
||||
};
|
||||
|
||||
switches = {
|
||||
setDPI = {dpi}:
|
||||
singleton "10_xrdb-dpi" "${lib.getExe pkgs.xorg.xrdb} -merge ${pkgs.writeText "xrdb-dpi-config" ''
|
||||
Xcursor.size: 64
|
||||
Xft.dpi: ${toString dpi}
|
||||
''}";
|
||||
switches = {
|
||||
setDPI =
|
||||
{ dpi }:
|
||||
singleton "10_xrdb-dpi" "${lib.getExe pkgs.xorg.xrdb} -merge ${pkgs.writeText "xrdb-dpi-config" ''
|
||||
Xcursor.size: 64
|
||||
Xft.dpi: ${toString dpi}
|
||||
''}";
|
||||
|
||||
# Is scoped to an output device, no need to be called on built-in display
|
||||
setSoftwareBrightness = {
|
||||
device, # obtain with `xrandr`
|
||||
brightness, # [0..1]
|
||||
}:
|
||||
# Hack:
|
||||
# xrandr would consider the display being connected before we can change its brightness
|
||||
# For that reason, we can't base our delay on its output, sadly.
|
||||
singleton "10_xrandr_brightness" ''
|
||||
sleep 10
|
||||
${lib.getExe pkgs.xorg.xrandr} --output ${device} --brightness ${toString brightness}
|
||||
'';
|
||||
# Is scoped to an output device, no need to be called on built-in display
|
||||
setSoftwareBrightness =
|
||||
{
|
||||
device, # obtain with `xrandr`
|
||||
brightness, # [0..1]
|
||||
}:
|
||||
singleton "10_xrandr_brightness" /* bash */ ''
|
||||
${lib.getExe pkgs.xorg.xrandr} --output ${device} --brightness ${toString brightness}
|
||||
'';
|
||||
|
||||
# Is scoped to an output device, no need to be called on built-in display
|
||||
setDDCBrightness = {
|
||||
modelName, # obtain with `ddcutil detect`
|
||||
brightness, # [0..1]
|
||||
}:
|
||||
singleton "10_ddc_brightness" ''
|
||||
${lib.getExe pkgs.ddcutil} --model ${modelName} setvcp 10 ${toString (builtins.floor (brightness * 100))}
|
||||
'';
|
||||
# Is scoped to an output device, no need to be called on built-in display
|
||||
setDDCBrightness =
|
||||
{
|
||||
modelName, # obtain with `ddcutil detect`
|
||||
brightness, # [0..1]
|
||||
}:
|
||||
singleton "10_ddc_brightness" /* bash */ ''
|
||||
${lib.getExe pkgs.ddcutil} --model ${modelName} setvcp 10 ${
|
||||
toString (builtins.floor (brightness * 100))
|
||||
}
|
||||
'';
|
||||
|
||||
setDDCContrast = {
|
||||
modelName, # obtain with `ddcutil detect`
|
||||
contrast, # [0..1]
|
||||
}:
|
||||
singleton "10_ddc_contrast" ''
|
||||
${lib.getExe pkgs.ddcutil} --model ${modelName} setvcp 12 ${toString (builtins.floor (contrast * 100))}
|
||||
'';
|
||||
};
|
||||
setDDCContrast =
|
||||
{
|
||||
modelName, # obtain with `ddcutil detect`
|
||||
contrast, # [0..1]
|
||||
}:
|
||||
singleton "10_ddc_contrast" /* bash */ ''
|
||||
${lib.getExe pkgs.ddcutil} --model ${modelName} setvcp 12 ${
|
||||
toString (builtins.floor (contrast * 100))
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
# Note: the "position" field corresponds to the "pos" field outputted by autorandr
|
||||
# To get the current config, run `xrandr --auto` and then `autorandr --config`
|
||||
configs = {
|
||||
allOff = lib.genAttrs devices.all (_: {enable = lib.mkDefault false;});
|
||||
enableBuiltin = {
|
||||
eDP-1 = {
|
||||
enable = true;
|
||||
crtc = 0;
|
||||
mode = "2256x1504";
|
||||
rate = "60.00";
|
||||
primary = true;
|
||||
# Note: the "position" field corresponds to the "pos" field outputted by autorandr
|
||||
# To get the current config, run `xrandr --auto` and then `autorandr --config`
|
||||
configs = {
|
||||
allOff = lib.genAttrs devices.all (_: {
|
||||
enable = lib.mkDefault false;
|
||||
});
|
||||
enableBuiltin = {
|
||||
eDP-1 = {
|
||||
enable = true;
|
||||
crtc = 0;
|
||||
mode = "2256x1504";
|
||||
rate = "60.00";
|
||||
primary = true;
|
||||
};
|
||||
};
|
||||
enableAmethyst = name: {
|
||||
${name} = {
|
||||
enable = true;
|
||||
primary = true;
|
||||
crtc = 1;
|
||||
mode = "2560x1440";
|
||||
rate = "59.95";
|
||||
};
|
||||
};
|
||||
enableOrchid = name: {
|
||||
${name} = {
|
||||
enable = true;
|
||||
primary = true;
|
||||
crtc = 1;
|
||||
mode = "1920x1080";
|
||||
rate = "60.00";
|
||||
};
|
||||
};
|
||||
};
|
||||
enableAmethyst = name: {
|
||||
${name} = {
|
||||
enable = true;
|
||||
primary = true;
|
||||
crtc = 1;
|
||||
mode = "2560x1440";
|
||||
rate = "59.95";
|
||||
};
|
||||
|
||||
frameworkBuiltin = {
|
||||
fingerprint = fingerprints.built-in;
|
||||
config = lib.mkMerge [
|
||||
configs.allOff
|
||||
configs.enableBuiltin
|
||||
];
|
||||
hooks.postswitch = switches.setDPI { dpi = 150; };
|
||||
};
|
||||
enableOrchid = name: {
|
||||
${name} = {
|
||||
enable = true;
|
||||
primary = true;
|
||||
crtc = 1;
|
||||
mode = "1920x1080";
|
||||
rate = "60.00";
|
||||
};
|
||||
|
||||
mkAmethyst = name: {
|
||||
fingerprint = lib.mkMerge [
|
||||
fingerprints.built-in
|
||||
(fingerprints.amethyst name)
|
||||
];
|
||||
config = lib.mkMerge [
|
||||
configs.allOff
|
||||
(configs.enableAmethyst name)
|
||||
];
|
||||
hooks.postswitch = lib.mkMerge [
|
||||
(switches.setDPI { dpi = 110; })
|
||||
(switches.setSoftwareBrightness {
|
||||
device = name;
|
||||
brightness = 1;
|
||||
})
|
||||
(switches.setDDCBrightness {
|
||||
modelName = "VG27AQL3A";
|
||||
brightness = 0;
|
||||
})
|
||||
(switches.setDDCContrast {
|
||||
modelName = "VG27AQL3A";
|
||||
contrast = 0.5;
|
||||
})
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
frameworkBuiltin = {
|
||||
fingerprint = fingerprints.built-in;
|
||||
config = lib.mkMerge [
|
||||
configs.allOff
|
||||
configs.enableBuiltin
|
||||
];
|
||||
hooks.postswitch = switches.setDPI {dpi = 150;};
|
||||
};
|
||||
|
||||
mkAmethyst = name: {
|
||||
fingerprint = lib.mkMerge [
|
||||
fingerprints.built-in
|
||||
(fingerprints.amethyst name)
|
||||
];
|
||||
config = lib.mkMerge [
|
||||
configs.allOff
|
||||
(configs.enableAmethyst name)
|
||||
];
|
||||
hooks.postswitch = lib.mkMerge [
|
||||
(switches.setDPI {dpi = 110;})
|
||||
(switches.setSoftwareBrightness {
|
||||
device = name;
|
||||
brightness = 1;
|
||||
})
|
||||
(switches.setDDCBrightness {
|
||||
modelName = "VG27AQL3A";
|
||||
brightness = 0;
|
||||
})
|
||||
(switches.setDDCContrast {
|
||||
modelName = "VG27AQL3A";
|
||||
contrast = 0.5;
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
mkOrchid = name: {
|
||||
fingerprint = lib.mkMerge [
|
||||
fingerprints.built-in
|
||||
(fingerprints.orchid name)
|
||||
];
|
||||
config = lib.mkMerge [
|
||||
configs.allOff
|
||||
(configs.enableOrchid name)
|
||||
];
|
||||
# seems like this display doesn't support DDC
|
||||
hooks.postswitch = lib.mkMerge [
|
||||
(switches.setDPI {dpi = 100;})
|
||||
(switches.setSoftwareBrightness {
|
||||
device = name;
|
||||
brightness = 0.7;
|
||||
})
|
||||
];
|
||||
};
|
||||
in
|
||||
mkOrchid = name: {
|
||||
fingerprint = lib.mkMerge [
|
||||
fingerprints.built-in
|
||||
(fingerprints.orchid name)
|
||||
];
|
||||
config = lib.mkMerge [
|
||||
configs.allOff
|
||||
(configs.enableOrchid name)
|
||||
];
|
||||
# seems like this display doesn't support DDC
|
||||
hooks.postswitch = lib.mkMerge [
|
||||
(switches.setDPI { dpi = 100; })
|
||||
(switches.setSoftwareBrightness {
|
||||
device = name;
|
||||
brightness = 0.5;
|
||||
})
|
||||
];
|
||||
};
|
||||
in
|
||||
lib.mkMerge [
|
||||
{default = frameworkBuiltin;}
|
||||
{ default = frameworkBuiltin; }
|
||||
(lib.genAttrs' devices.extern (name: lib.nameValuePair "amethyst-${name}" (mkAmethyst name)))
|
||||
(lib.genAttrs' devices.extern (name: lib.nameValuePair "orchid-${name}" (mkOrchid name)))
|
||||
];
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
services.btrfs.autoScrub = {
|
||||
enable = true;
|
||||
fileSystems = [
|
||||
|
|
@ -21,9 +22,9 @@
|
|||
|
||||
fileSystems = {
|
||||
/*
|
||||
WARNING:
|
||||
Use "noauto" if you want to mount the drive at a later time and not all the time
|
||||
Otherwise the mount would fail and cascade into the graphical session being stopped
|
||||
WARNING:
|
||||
Use "noauto" if you want to mount the drive at a later time and not all the time
|
||||
Otherwise the mount would fail and cascade into the graphical session being stopped
|
||||
*/
|
||||
|
||||
"/home/leana/mnt/tdk32" = {
|
||||
|
|
@ -53,21 +54,23 @@
|
|||
sgbk /dev/disk/by-uuid/21b5207e-c3cf-49da-b944-fb405ae1eee2 ${config.age.secrets.sgbk_pwd.path} noauto
|
||||
'';
|
||||
|
||||
systemd.mounts = let
|
||||
bindToCryptDev = dev: {
|
||||
what = "/dev/mapper/${dev}";
|
||||
where = "/mnt/${dev}";
|
||||
unitConfig = {
|
||||
Requires = ["systemd-cryptsetup@${dev}.service"];
|
||||
After = ["systemd-cryptsetup@${dev}.service"];
|
||||
PropagatesStopTo = ["systemd-cryptsetup@${dev}.service"];
|
||||
systemd.mounts =
|
||||
let
|
||||
bindToCryptDev = dev: {
|
||||
what = "/dev/mapper/${dev}";
|
||||
where = "/mnt/${dev}";
|
||||
unitConfig = {
|
||||
Requires = [ "systemd-cryptsetup@${dev}.service" ];
|
||||
After = [ "systemd-cryptsetup@${dev}.service" ];
|
||||
PropagatesStopTo = [ "systemd-cryptsetup@${dev}.service" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
in [
|
||||
(bindToCryptDev "four")
|
||||
(bindToCryptDev "two")
|
||||
(bindToCryptDev "sgbk")
|
||||
];
|
||||
in
|
||||
[
|
||||
(bindToCryptDev "four")
|
||||
(bindToCryptDev "two")
|
||||
(bindToCryptDev "sgbk")
|
||||
];
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.lsof
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
services.xserver.windowManager.xmonad = {
|
||||
enable = true;
|
||||
enableContribAndExtras = true;
|
||||
|
|
@ -14,13 +15,29 @@
|
|||
autoRepeatInterval = 40;
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.pantheon.elementary-sound-theme
|
||||
];
|
||||
services.xserver.displayManager.lightdm = {
|
||||
enable = true;
|
||||
background = "#000000";
|
||||
greeters.gtk.cursorTheme = {
|
||||
name = "Posy_Cursor_Black";
|
||||
package = pkgs.posy-cursors;
|
||||
size = 72;
|
||||
greeters.gtk = {
|
||||
iconTheme = {
|
||||
name = "Adwaita";
|
||||
package = pkgs.gnome-themes-extra;
|
||||
};
|
||||
theme = {
|
||||
name = "Adwaita";
|
||||
package = pkgs.gnome-themes-extra;
|
||||
};
|
||||
cursorTheme = {
|
||||
name = "Posy_Cursor_Black";
|
||||
package = pkgs.posy-cursors;
|
||||
size = 72;
|
||||
};
|
||||
extraConfig = ''
|
||||
gtk-sound-theme-name = elementary
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -28,7 +45,7 @@
|
|||
enable = true;
|
||||
hooks = {
|
||||
# Reset display setting on login
|
||||
"UNBLANK" = ''
|
||||
"RUN" = ''
|
||||
${lib.getExe pkgs.autorandr} --change --ignore-lid
|
||||
'';
|
||||
};
|
||||
|
|
@ -36,8 +53,10 @@
|
|||
|
||||
services.picom = {
|
||||
enable = true;
|
||||
backend = "glx";
|
||||
# avoid tearing
|
||||
vSync = true;
|
||||
|
||||
# buttery smooth
|
||||
fade = true;
|
||||
fadeDelta = 3;
|
||||
settings = {
|
||||
|
|
|
|||
|
|
@ -7,15 +7,20 @@
|
|||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "thunderbolt"];
|
||||
boot.initrd.kernelModules = ["dm-snapshot"];
|
||||
boot.kernelModules = ["kvm-amd"];
|
||||
boot.extraModulePackages = [];
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"thunderbolt"
|
||||
];
|
||||
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
};
|
||||
};
|
||||
|
||||
me.extraGroups = ["scanner"];
|
||||
me.extraGroups = [ "scanner" ];
|
||||
hardware.sane = {
|
||||
enable = true;
|
||||
brscan5.enable = true;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{lib, ...}: {
|
||||
{ lib, ... }:
|
||||
{
|
||||
# https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
||||
# `timedatectl list-timezones`
|
||||
time.timeZone = "Asia/Taipei";
|
||||
|
|
@ -28,16 +29,16 @@
|
|||
let
|
||||
genLocale = locale: lib.flip lib.genAttrs (_: locale);
|
||||
in
|
||||
# - xscreensaver freaks out on the time display
|
||||
# - evolution add event becomes hard to use
|
||||
# https://gitlab.gnome.org/GNOME/evolution/-/issues/3120
|
||||
genLocale "fr_FR.UTF-8" [
|
||||
"LC_TIME"
|
||||
]
|
||||
// genLocale "zh_TW.UTF-8" [
|
||||
"LC_MONETARY"
|
||||
"LC_ADDRESS"
|
||||
];
|
||||
# - xscreensaver freaks out on the time display
|
||||
# - evolution add event becomes hard to use
|
||||
# https://gitlab.gnome.org/GNOME/evolution/-/issues/3120
|
||||
genLocale "fr_FR.UTF-8" [
|
||||
"LC_TIME"
|
||||
]
|
||||
// genLocale "zh_TW.UTF-8" [
|
||||
"LC_MONETARY"
|
||||
"LC_ADDRESS"
|
||||
];
|
||||
};
|
||||
|
||||
# Wireless Regulatory Domain, uses ISO / IEC 3166 country code
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
system.stateVersion = "24.11";
|
||||
|
||||
|
|
@ -13,4 +14,9 @@
|
|||
# https://community.frame.work/t/stability-issues-random-crashes-reboots-and-boot-freezes/62675/4
|
||||
"pcie_aspm=off"
|
||||
];
|
||||
|
||||
# Cross building
|
||||
# https://discourse.nixos.org/t/how-do-i-get-my-aarch64-linux-machine-to-build-x86-64-linux-extra-platforms-doesnt-seem-to-work/38106/2?u=leana8959
|
||||
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
||||
nix.settings.extra-platforms = config.boot.binfmt.emulatedSystems;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,14 +2,15 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
#
|
||||
# Docker
|
||||
#
|
||||
{
|
||||
virtualisation.docker.enable = true;
|
||||
me.extraGroups = ["docker"];
|
||||
me.extraGroups = [ "docker" ];
|
||||
}
|
||||
|
||||
# #
|
||||
|
|
@ -48,6 +49,9 @@
|
|||
services.gnome.gnome-keyring.enable = true;
|
||||
|
||||
services = {
|
||||
# Since we don't have a lot of swap, we make sure we kill the processes and not halt the machine
|
||||
earlyoom.enable = true;
|
||||
|
||||
postgresql = {
|
||||
enable = true;
|
||||
authentication = lib.mkOverride 10 ''
|
||||
|
|
@ -63,10 +67,10 @@
|
|||
enable = true;
|
||||
filters = ''
|
||||
category "Spotify" {
|
||||
params "context@open.spotify.com" "si@open.spotify.com"
|
||||
params "context@*spotify.com" "si@*spotify.com"
|
||||
}
|
||||
category "YouTube" {
|
||||
params "si@youtu.be" "pp@youtu.be" "si@youtube.com" "pp@youtube.com"
|
||||
params "si@youtu.be" "pp@youtu.be" "si@*youtube.com" "pp@*youtube.com"
|
||||
}
|
||||
category "WTF" {
|
||||
params "utm_*"
|
||||
|
|
|
|||
|
|
@ -1,91 +1,94 @@
|
|||
{config, ...}: {
|
||||
services.restic.backups = let
|
||||
pruneOpts = [
|
||||
"--keep-daily 7"
|
||||
"--keep-weekly 4"
|
||||
"--keep-monthly 12"
|
||||
"--keep-yearly 10"
|
||||
];
|
||||
in {
|
||||
"backblaze" = {
|
||||
paths = [
|
||||
"/home/leana/Documents"
|
||||
"/home/leana/Calibre"
|
||||
{ config, ... }:
|
||||
{
|
||||
services.restic.backups =
|
||||
let
|
||||
pruneOpts = [
|
||||
"--keep-daily 7"
|
||||
"--keep-weekly 4"
|
||||
"--keep-monthly 12"
|
||||
"--keep-yearly 10"
|
||||
];
|
||||
in
|
||||
{
|
||||
"backblaze" = {
|
||||
paths = [
|
||||
"/home/leana/Documents"
|
||||
"/home/leana/Calibre"
|
||||
];
|
||||
|
||||
passwordFile = config.age.secrets.restic_backblaze_pwd.path;
|
||||
repositoryFile = config.age.secrets.restic_backblaze_repo.path;
|
||||
environmentFile = config.age.secrets.restic_backblaze_env.path;
|
||||
passwordFile = config.age.secrets.restic_backblaze_pwd.path;
|
||||
repositoryFile = config.age.secrets.restic_backblaze_repo.path;
|
||||
environmentFile = config.age.secrets.restic_backblaze_env.path;
|
||||
|
||||
timerConfig = {
|
||||
OnCalendar = "daily";
|
||||
Persistent = true;
|
||||
RandomizedDelaySec = "1h";
|
||||
timerConfig = {
|
||||
OnCalendar = "daily";
|
||||
Persistent = true;
|
||||
RandomizedDelaySec = "1h";
|
||||
};
|
||||
|
||||
inherit pruneOpts;
|
||||
};
|
||||
|
||||
inherit pruneOpts;
|
||||
"four" = {
|
||||
paths = [
|
||||
"/home/leana/Music"
|
||||
"/home/leana/Documents"
|
||||
"/home/leana/Calibre"
|
||||
"/home/leana/Images"
|
||||
];
|
||||
|
||||
repository = "/mnt/four/restic";
|
||||
passwordFile = config.age.secrets.restic_four_pwd.path;
|
||||
|
||||
timerConfig = null;
|
||||
|
||||
inherit pruneOpts;
|
||||
};
|
||||
|
||||
"sgbk" = {
|
||||
paths = [
|
||||
"/home/leana/Music"
|
||||
"/home/leana/Documents"
|
||||
"/home/leana/Calibre"
|
||||
"/home/leana/Images"
|
||||
];
|
||||
|
||||
timerConfig = null;
|
||||
|
||||
repository = "/mnt/sgbk/restic";
|
||||
passwordFile = config.age.secrets.restic_sgbk_pwd.path;
|
||||
|
||||
inherit pruneOpts;
|
||||
};
|
||||
|
||||
"two-to-four" = {
|
||||
paths = [ "/mnt/two" ];
|
||||
|
||||
timerConfig = null;
|
||||
|
||||
repository = "/mnt/four/restic";
|
||||
passwordFile = config.age.secrets.restic_four_pwd.path;
|
||||
|
||||
exclude = [ "lost+found" ];
|
||||
|
||||
inherit pruneOpts;
|
||||
};
|
||||
};
|
||||
|
||||
"four" = {
|
||||
paths = [
|
||||
"/home/leana/Music"
|
||||
"/home/leana/Documents"
|
||||
"/home/leana/Calibre"
|
||||
"/home/leana/Images"
|
||||
];
|
||||
|
||||
repository = "/mnt/four/restic";
|
||||
passwordFile = config.age.secrets.restic_four_pwd.path;
|
||||
|
||||
timerConfig = null;
|
||||
|
||||
inherit pruneOpts;
|
||||
};
|
||||
|
||||
"sgbk" = {
|
||||
paths = [
|
||||
"/home/leana/Music"
|
||||
"/home/leana/Documents"
|
||||
"/home/leana/Calibre"
|
||||
"/home/leana/Images"
|
||||
];
|
||||
|
||||
timerConfig = null;
|
||||
|
||||
repository = "/mnt/sgbk/restic";
|
||||
passwordFile = config.age.secrets.restic_sgbk_pwd.path;
|
||||
|
||||
inherit pruneOpts;
|
||||
};
|
||||
|
||||
"two-to-four" = {
|
||||
paths = ["/mnt/two"];
|
||||
|
||||
timerConfig = null;
|
||||
|
||||
repository = "/mnt/four/restic";
|
||||
passwordFile = config.age.secrets.restic_four_pwd.path;
|
||||
|
||||
exclude = ["lost+found"];
|
||||
|
||||
inherit pruneOpts;
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services = {
|
||||
# TODO:
|
||||
# Wait for upstream to introduce direct access to unitConfig
|
||||
# c.f. https://github.com/NixOS/nixpkgs/pull/368234
|
||||
"restic-backups-four" = {
|
||||
requires = ["mnt-four.mount"];
|
||||
after = ["mnt-four.mount"];
|
||||
unitConfig.PropagatesStopTo = ["mnt-four.mount"];
|
||||
requires = [ "mnt-four.mount" ];
|
||||
after = [ "mnt-four.mount" ];
|
||||
unitConfig.PropagatesStopTo = [ "mnt-four.mount" ];
|
||||
};
|
||||
|
||||
"restic-backups-sgbk" = {
|
||||
requires = ["mnt-sgbk.mount"];
|
||||
after = ["mnt-sgbk.mount"];
|
||||
unitConfig.PropagatesStopTo = ["mnt-sgbk.mount"];
|
||||
requires = [ "mnt-sgbk.mount" ];
|
||||
after = [ "mnt-sgbk.mount" ];
|
||||
unitConfig.PropagatesStopTo = [ "mnt-sgbk.mount" ];
|
||||
};
|
||||
|
||||
"restic-backups-two-to-four" = {
|
||||
|
|
|
|||
|
|
@ -1,80 +0,0 @@
|
|||
# https://nixos.wiki/wiki/Encrypted_DNS
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
networking = {
|
||||
nameservers = ["127.0.0.1" "::1"];
|
||||
dhcpcd.extraConfig = "nohook resolv.conf";
|
||||
# networkmanager.dns = "none";
|
||||
};
|
||||
|
||||
services.resolved.enable = false;
|
||||
|
||||
services.dnscrypt-proxy2 = {
|
||||
enable = true;
|
||||
# Settings reference:
|
||||
# https://github.com/DNSCrypt/dnscrypt-proxy/blob/master/dnscrypt-proxy/example-dnscrypt-proxy.toml
|
||||
settings = {
|
||||
listen_addresses = ["127.0.0.1:53"];
|
||||
ipv4_servers = true;
|
||||
|
||||
require_dnssec = true;
|
||||
require_nolog = true;
|
||||
require_nofilter = true;
|
||||
|
||||
lb_strategy = "p2";
|
||||
lb_estimator = true;
|
||||
|
||||
# Blocklists are made of one pattern per line.
|
||||
# https://github.com/DNSCrypt/dnscrypt-proxy/blob/fa59f990431a49b6485f63f96601bc7e64017bf8/dnscrypt-proxy/example-dnscrypt-proxy.toml#L583C4-L583C75
|
||||
blocked_names.blocked_names_file = let
|
||||
# Prevent building up reliance on chatbots
|
||||
# Gotta preserve that thinking ability of my smoof bwain
|
||||
ai_list = let
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "laylavish";
|
||||
repo = "uBlockOrigin-HUGE-AI-Blocklist";
|
||||
rev = "9bb188e2701138e03f73bacebd6b19b181ca0012";
|
||||
hash = "sha256-p3wfR28DH6V8BHn9DT10d09Yq3mdbBecWwlR1CdDYUA=";
|
||||
};
|
||||
in
|
||||
lib.pipe (builtins.readFile "${src}/noai_hosts.txt") [
|
||||
(lib.replaceStrings ["\r\n"] ["\n"]) # convert to unix ending just in case
|
||||
(lib.splitString "\n")
|
||||
(builtins.filter (x: ! (x == "" || lib.hasPrefix "#" x)))
|
||||
(builtins.map (x: builtins.elemAt (lib.splitString " " x) 1)) # remove 0.0.0.0
|
||||
];
|
||||
|
||||
hategroup_list = let
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "chigh";
|
||||
repo = "hategroup-dnsbl";
|
||||
rev = "cc19c050997d5f54014bb20c764b131e003dfb17";
|
||||
hash = "sha256-SZBrjIBUw687MdrbOV7WrP5IhAAtKvPL2GqdcICHNvQ=";
|
||||
};
|
||||
in
|
||||
lib.pipe (builtins.readFile "${src}/blocklist.txt") [
|
||||
(lib.replaceStrings ["\r\n"] ["\n"]) # convert to unix ending just in case
|
||||
(lib.splitString "\n")
|
||||
(builtins.filter (x: ! (x == "" || lib.hasPrefix "#" x)))
|
||||
];
|
||||
|
||||
combined_lists = ai_list ++ hategroup_list;
|
||||
in
|
||||
pkgs.writeText "dnsblocklist" (builtins.concatStringsSep "\n" combined_lists);
|
||||
|
||||
# Add this to test if dnscrypt-proxy is actually used to resolve DNS requests
|
||||
# query_log.file = "/var/log/dnscrypt-proxy/query.log";
|
||||
sources.public-resolvers = {
|
||||
urls = [
|
||||
"https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md"
|
||||
"https://download.dnscrypt.info/resolvers-list/v3/public-resolvers.md"
|
||||
];
|
||||
cache_file = "/var/cache/dnscrypt-proxy/public-resolvers.md";
|
||||
minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,27 +1,29 @@
|
|||
{lib, ...}: {
|
||||
{ lib, ... }:
|
||||
{
|
||||
nixpkgs.config.allowUnfreePredicate = lib.mkDefault (
|
||||
pkg: let
|
||||
pkg:
|
||||
let
|
||||
name = lib.getName pkg;
|
||||
in
|
||||
builtins.elem name [
|
||||
"languagetool"
|
||||
builtins.elem name [
|
||||
"languagetool"
|
||||
|
||||
"vscode"
|
||||
"code"
|
||||
"vscode"
|
||||
"code"
|
||||
|
||||
"tampermonkey"
|
||||
"tampermonkey"
|
||||
|
||||
"aseprite"
|
||||
"aseprite"
|
||||
|
||||
"posy-cursors"
|
||||
"posy-cursors"
|
||||
|
||||
"discord"
|
||||
]
|
||||
|| builtins.any (lib.flip lib.hasInfix name) [
|
||||
# Scanner
|
||||
"brscan5"
|
||||
"discord"
|
||||
]
|
||||
|| builtins.any (lib.flip lib.hasInfix name) [
|
||||
# Scanner
|
||||
"brscan5"
|
||||
|
||||
"steam"
|
||||
]
|
||||
"steam"
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,57 +9,63 @@ let
|
|||
|
||||
infuse = lib.flip infuse-lib.v1.infuse;
|
||||
in
|
||||
# Why shouldn't I go crazy with overlays?
|
||||
final:
|
||||
infuse {
|
||||
cmus.__input.alsaSupport = _: false;
|
||||
# Why shouldn't I go crazy with overlays?
|
||||
final:
|
||||
infuse {
|
||||
cmus.__input.alsaSupport = _: false;
|
||||
|
||||
fish.__input.usePython = _: false;
|
||||
fish.__input.usePython = _: false;
|
||||
|
||||
tmux.__input.withSixel = _: false;
|
||||
tmux.__input.withSixel = _: false;
|
||||
|
||||
vlc.__input.chromecastSupport = _: false;
|
||||
vlc.__input.waylandSupport = _: false;
|
||||
vlc.__input.chromecastSupport = _: false;
|
||||
vlc.__input.waylandSupport = _: false;
|
||||
|
||||
# I don't really use helix, but it's nice to have the W alias just in case
|
||||
helix.__output.patches.__append = [
|
||||
./patches/helix/W-as-write.patch
|
||||
];
|
||||
# I don't really use helix, but it's nice to have the W alias just in case
|
||||
helix.__output.patches.__append = [
|
||||
./patches/helix/W-as-write.patch
|
||||
];
|
||||
|
||||
# Too loud
|
||||
alejandra.__output.patches.__append = [
|
||||
./patches/alejandra/no-ads.patch
|
||||
];
|
||||
alejandra.__output.doCheck = _: false;
|
||||
# Too loud
|
||||
alejandra.__output.patches.__append = [
|
||||
./patches/alejandra/no-ads.patch
|
||||
];
|
||||
alejandra.__output.doCheck = _: false;
|
||||
|
||||
# TODO:
|
||||
# pinned branch of https://github.com/astrand/xclip/tree/xerror
|
||||
# use this until #43 gets resolved properly
|
||||
xclip.__output.src = _:
|
||||
final.fetchFromGitHub {
|
||||
owner = "astrand";
|
||||
repo = "xclip";
|
||||
rev = "2c3b811002b35d3be7f39cc1145dd06bdb32e31c";
|
||||
hash = "sha256-hHbq97GTKiRw8LZa/LY4LUOFOd/5H4+S+NR0BJfcu6M=";
|
||||
};
|
||||
# TODO:
|
||||
# pinned branch of https://github.com/astrand/xclip/tree/xerror
|
||||
# use this until #43 gets resolved properly
|
||||
xclip.__output.src =
|
||||
_:
|
||||
final.fetchFromGitHub {
|
||||
owner = "astrand";
|
||||
repo = "xclip";
|
||||
rev = "2c3b811002b35d3be7f39cc1145dd06bdb32e31c";
|
||||
hash = "sha256-hHbq97GTKiRw8LZa/LY4LUOFOd/5H4+S+NR0BJfcu6M=";
|
||||
};
|
||||
|
||||
fcitx5.__output.cmakeFlags.__append = [
|
||||
(lib.cmakeFeature "ENABLE_EMOJI" "Off")
|
||||
(lib.cmakeFeature "ENABLE_WAYLAND" "Off")
|
||||
];
|
||||
fcitx5.__output.patches.__append = [
|
||||
./patches/fcitx5/disable-clipboard.patch
|
||||
./patches/fcitx5/disable-quickphrase.patch
|
||||
./patches/fcitx5/disable-unicode.patch
|
||||
];
|
||||
fcitx5-chinese-addons.__output.cmakeFlags.__append = [
|
||||
(lib.cmakeFeature "ENABLE_BROWSER" "Off")
|
||||
(lib.cmakeFeature "ENABLE_CLOUDPINYIN" "Off")
|
||||
(lib.cmakeFeature "ENABLE_DATA" "Off")
|
||||
];
|
||||
fcitx5-chinese-addons.__output.patches.__append = [
|
||||
./patches/fcitx5-chinese-addons/disable-chttrans.patch
|
||||
./patches/fcitx5-chinese-addons/disable-fullwidth.patch
|
||||
# Note: disabling pinyin helper breaks canjie
|
||||
];
|
||||
}
|
||||
fcitx5.__output.cmakeFlags.__append = [
|
||||
(lib.cmakeFeature "ENABLE_EMOJI" "Off")
|
||||
(lib.cmakeFeature "ENABLE_WAYLAND" "Off")
|
||||
];
|
||||
fcitx5.__output.patches.__append = [
|
||||
./patches/fcitx5/disable-clipboard.patch
|
||||
./patches/fcitx5/disable-quickphrase.patch
|
||||
./patches/fcitx5/disable-unicode.patch
|
||||
];
|
||||
qt6Packages.fcitx5-chinese-addons.__output.cmakeFlags.__append = [
|
||||
(lib.cmakeFeature "ENABLE_BROWSER" "Off")
|
||||
(lib.cmakeFeature "ENABLE_CLOUDPINYIN" "Off") # c.f. patch below
|
||||
(lib.cmakeFeature "ENABLE_DATA" "Off")
|
||||
];
|
||||
qt6Packages.fcitx5-chinese-addons.__output.patches.__append = [
|
||||
./patches/fcitx5-chinese-addons/disable-chttrans.patch
|
||||
./patches/fcitx5-chinese-addons/disable-fullwidth.patch
|
||||
(final.fetchpatch {
|
||||
name = "cloudpinyin-disable-build"; # without this the option would fail
|
||||
url = "https://github.com/fcitx/fcitx5-chinese-addons/commit/92ffd494273a5573347c1fe2667fb8d67a5303db.patch";
|
||||
hash = "sha256-Mo5l8tsn1JQxTFHxOZfQRmbCeWZHLyxfn2Qwv/gQXGA=";
|
||||
})
|
||||
# Note: disabling pinyin helper breaks canjie
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
diff --git a/modules/chttrans/CMakeLists.txt b/modules/chttrans/CMakeLists.txt
|
||||
index 6c73ea8..8ed5660 100644
|
||||
index e2f5f43..61c6590 100644
|
||||
--- a/modules/chttrans/CMakeLists.txt
|
||||
+++ b/modules/chttrans/CMakeLists.txt
|
||||
@@ -1,20 +1,20 @@
|
||||
|
|
@ -10,7 +10,7 @@ index 6c73ea8..8ed5660 100644
|
|||
- set(CHTTRANS_SOURCES ${CHTTRANS_SOURCES} chttrans-opencc.cpp)
|
||||
-endif()
|
||||
-add_fcitx5_addon(chttrans ${CHTTRANS_SOURCES})
|
||||
-target_link_libraries(chttrans Fcitx5::Core Fcitx5::Config Fcitx5::Module::Notifications Boost::iostreams ${FMT_TARGET})
|
||||
-target_link_libraries(chttrans Fcitx5::Core Fcitx5::Config Fcitx5::Module::Notifications)
|
||||
-if (ENABLE_OPENCC)
|
||||
- target_link_libraries(chttrans OpenCC::OpenCC)
|
||||
- if (TARGET Boost::json)
|
||||
|
|
@ -25,7 +25,7 @@ index 6c73ea8..8ed5660 100644
|
|||
+# set(CHTTRANS_SOURCES ${CHTTRANS_SOURCES} chttrans-opencc.cpp)
|
||||
+# endif()
|
||||
+# add_fcitx5_addon(chttrans ${CHTTRANS_SOURCES})
|
||||
+# target_link_libraries(chttrans Fcitx5::Core Fcitx5::Config Fcitx5::Module::Notifications Boost::iostreams ${FMT_TARGET})
|
||||
+# target_link_libraries(chttrans Fcitx5::Core Fcitx5::Config Fcitx5::Module::Notifications)
|
||||
+# if (ENABLE_OPENCC)
|
||||
+# target_link_libraries(chttrans OpenCC::OpenCC)
|
||||
+# if (TARGET Boost::json)
|
||||
|
|
@ -42,7 +42,7 @@ index 6c73ea8..8ed5660 100644
|
|||
+# COMPONENT config)
|
||||
+# install(FILES gbks2t.tab DESTINATION "${CMAKE_INSTALL_DATADIR}/fcitx5/chttrans" COMPONENT config)
|
||||
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
|
||||
index 994a4d1..9322834 100644
|
||||
index 5a8c94c..2feccd0 100644
|
||||
--- a/test/CMakeLists.txt
|
||||
+++ b/test/CMakeLists.txt
|
||||
@@ -23,10 +23,10 @@ add_dependencies(testfullwidth fullwidth fullwidth.conf.in-fmt)
|
||||
|
|
@ -50,14 +50,13 @@ index 994a4d1..9322834 100644
|
|||
|
||||
add_subdirectory(inputmethod)
|
||||
-add_executable(testchttrans testchttrans.cpp)
|
||||
-target_link_libraries(testchttrans Fcitx5::Core Fcitx5::Module::TestFrontend Fcitx5::Module::TestIM Pthread::Pthread)
|
||||
-target_link_libraries(testchttrans Fcitx5::Core Fcitx5::Module::TestFrontend Fcitx5::Module::TestIM)
|
||||
-add_dependencies(testchttrans chttrans chttrans.conf.in-fmt copy-addon copy-testim)
|
||||
-add_test(NAME testchttrans COMMAND testchttrans)
|
||||
+# add_executable(testchttrans testchttrans.cpp)
|
||||
+# target_link_libraries(testchttrans Fcitx5::Core Fcitx5::Module::TestFrontend Fcitx5::Module::TestIM Pthread::Pthread)
|
||||
+# target_link_libraries(testchttrans Fcitx5::Core Fcitx5::Module::TestFrontend Fcitx5::Module::TestIM)
|
||||
+# add_dependencies(testchttrans chttrans chttrans.conf.in-fmt copy-addon copy-testim)
|
||||
+# add_test(NAME testchttrans COMMAND testchttrans)
|
||||
|
||||
add_subdirectory(addon)
|
||||
add_executable(testpinyin testpinyin.cpp)
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ index 6e275bd..2dabd86 100644
|
|||
+# install(FILES "${CMAKE_CURRENT_BINARY_DIR}/fullwidth.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon"
|
||||
+# COMPONENT config)
|
||||
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
|
||||
index 994a4d1..f354bfd 100644
|
||||
index 5a8c94c..0f0b130 100644
|
||||
--- a/test/CMakeLists.txt
|
||||
+++ b/test/CMakeLists.txt
|
||||
@@ -17,10 +17,10 @@ target_link_libraries(testpinyinhelper Fcitx5::Core Fcitx5::Module::PinyinHelper
|
||||
|
|
@ -30,14 +30,13 @@ index 994a4d1..f354bfd 100644
|
|||
add_test(NAME testpinyinhelper COMMAND testpinyinhelper)
|
||||
|
||||
-add_executable(testfullwidth testfullwidth.cpp)
|
||||
-target_link_libraries(testfullwidth Fcitx5::Core Fcitx5::Module::TestFrontend Fcitx5::Module::TestIM Pthread::Pthread)
|
||||
-target_link_libraries(testfullwidth Fcitx5::Core Fcitx5::Module::TestFrontend Fcitx5::Module::TestIM)
|
||||
-add_dependencies(testfullwidth fullwidth fullwidth.conf.in-fmt)
|
||||
-add_test(NAME testfullwidth COMMAND testfullwidth)
|
||||
+# add_executable(testfullwidth testfullwidth.cpp)
|
||||
+# target_link_libraries(testfullwidth Fcitx5::Core Fcitx5::Module::TestFrontend Fcitx5::Module::TestIM Pthread::Pthread)
|
||||
+# target_link_libraries(testfullwidth Fcitx5::Core Fcitx5::Module::TestFrontend Fcitx5::Module::TestIM)
|
||||
+# add_dependencies(testfullwidth fullwidth fullwidth.conf.in-fmt)
|
||||
+# add_test(NAME testfullwidth COMMAND testfullwidth)
|
||||
|
||||
add_subdirectory(inputmethod)
|
||||
add_executable(testchttrans testchttrans.cpp)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
diff --git a/src/modules/clipboard/CMakeLists.txt b/src/modules/clipboard/CMakeLists.txt
|
||||
index 997c4e3e..4163cada 100644
|
||||
index afeaa6d3..ad4e77e0 100644
|
||||
--- a/src/modules/clipboard/CMakeLists.txt
|
||||
+++ b/src/modules/clipboard/CMakeLists.txt
|
||||
@@ -1,21 +1,21 @@
|
||||
@@ -1,25 +1,25 @@
|
||||
-add_fcitx5_addon(clipboard)
|
||||
-
|
||||
-target_sources(clipboard PRIVATE clipboard.cpp)
|
||||
|
|
@ -15,7 +15,11 @@ index 997c4e3e..4163cada 100644
|
|||
-
|
||||
-if (WAYLAND_FOUND)
|
||||
- target_sources(clipboard PRIVATE waylandclipboard.cpp)
|
||||
- target_link_libraries(clipboard Fcitx5::Module::Wayland Fcitx5::Wayland::WLRDataControl Pthread::Pthread)
|
||||
- target_link_libraries(clipboard
|
||||
- Fcitx5::Module::Wayland
|
||||
- Fcitx5::Wayland::WLRDataControl
|
||||
- Fcitx5::Wayland::ExtDataControl
|
||||
- Pthread::Pthread)
|
||||
-endif()
|
||||
-
|
||||
-install(TARGETS clipboard DESTINATION "${FCITX_INSTALL_ADDONDIR}")
|
||||
|
|
@ -33,7 +37,11 @@ index 997c4e3e..4163cada 100644
|
|||
+#
|
||||
+# if (WAYLAND_FOUND)
|
||||
+# target_sources(clipboard PRIVATE waylandclipboard.cpp)
|
||||
+# target_link_libraries(clipboard Fcitx5::Module::Wayland Fcitx5::Wayland::WLRDataControl Pthread::Pthread)
|
||||
+# target_link_libraries(clipboard
|
||||
+# Fcitx5::Module::Wayland
|
||||
+# Fcitx5::Wayland::WLRDataControl
|
||||
+# Fcitx5::Wayland::ExtDataControl
|
||||
+# Pthread::Pthread)
|
||||
+# endif()
|
||||
+#
|
||||
+# install(TARGETS clipboard DESTINATION "${FCITX_INSTALL_ADDONDIR}")
|
||||
|
|
@ -42,4 +50,3 @@ index 997c4e3e..4163cada 100644
|
|||
configure_file(clipboard.conf.in.in clipboard.conf.in @ONLY)
|
||||
fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/clipboard.conf.in clipboard.conf)
|
||||
fcitx5_export_module(Clipboard TARGET clipboard BUILD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" HEADERS clipboard_public.h INSTALL)
|
||||
|
||||
|
|
|
|||
|
|
@ -25,10 +25,10 @@ index b5bc37ac..04f4da59 100644
|
|||
+# FILES_MATCHING PATTERN "*.mb")
|
||||
|
||||
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
|
||||
index 97eed1f3..53e09977 100644
|
||||
index 643d96f4..0916c732 100644
|
||||
--- a/test/CMakeLists.txt
|
||||
+++ b/test/CMakeLists.txt
|
||||
@@ -147,10 +147,10 @@ if (ENABLE_KEYBOARD)
|
||||
@@ -162,10 +162,10 @@ if (ENABLE_KEYBOARD)
|
||||
add_test(NAME testspell COMMAND testspell)
|
||||
endif()
|
||||
|
||||
|
|
@ -43,4 +43,3 @@ index 97eed1f3..53e09977 100644
|
|||
|
||||
if (ENABLE_X11)
|
||||
add_executable(testxim testxim.cpp)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
diff --git a/src/modules/unicode/CMakeLists.txt b/src/modules/unicode/CMakeLists.txt
|
||||
index 73f7e064..afddabee 100644
|
||||
index 11512ecf..9efde8ac 100644
|
||||
--- a/src/modules/unicode/CMakeLists.txt
|
||||
+++ b/src/modules/unicode/CMakeLists.txt
|
||||
@@ -1,11 +1,11 @@
|
||||
-add_fcitx5_addon(unicode unicode.cpp charselectdata.cpp)
|
||||
-target_link_libraries(unicode Fcitx5::Core Fcitx5::Module::Clipboard ${FMT_TARGET})
|
||||
-target_link_libraries(unicode Fcitx5::Core Fcitx5::Module::Clipboard)
|
||||
-install(TARGETS unicode DESTINATION "${FCITX_INSTALL_ADDONDIR}")
|
||||
+# add_fcitx5_addon(unicode unicode.cpp charselectdata.cpp)
|
||||
+# target_link_libraries(unicode Fcitx5::Core Fcitx5::Module::Clipboard ${FMT_TARGET})
|
||||
+# target_link_libraries(unicode Fcitx5::Core Fcitx5::Module::Clipboard)
|
||||
+# install(TARGETS unicode DESTINATION "${FCITX_INSTALL_ADDONDIR}")
|
||||
configure_file(unicode.conf.in.in unicode.conf.in @ONLY)
|
||||
fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/unicode.conf.in unicode.conf)
|
||||
|
|
@ -21,10 +21,10 @@ index 73f7e064..afddabee 100644
|
|||
+# install(FILES charselectdata DESTINATION "${FCITX_INSTALL_PKGDATADIR}/unicode" COMPONENT config)
|
||||
|
||||
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
|
||||
index 97eed1f3..ff902c88 100644
|
||||
index 643d96f4..d008183a 100644
|
||||
--- a/test/CMakeLists.txt
|
||||
+++ b/test/CMakeLists.txt
|
||||
@@ -134,10 +134,10 @@ add_dependencies(testemoji emoji emoji.conf.in-fmt)
|
||||
@@ -149,10 +149,10 @@ add_dependencies(testemoji emoji emoji.conf.in-fmt)
|
||||
add_test(NAME testemoji COMMAND testemoji)
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -4,56 +4,65 @@
|
|||
let
|
||||
sources = import ../../npins;
|
||||
in
|
||||
{pkgs ? import sources.pin-florashell {}}:
|
||||
pkgs.mkShell (let
|
||||
libs = with pkgs; [
|
||||
zlib
|
||||
libpq
|
||||
libsodium
|
||||
];
|
||||
{
|
||||
pkgs ? import sources.pin-florashell { },
|
||||
}:
|
||||
pkgs.mkShell (
|
||||
let
|
||||
libs = with pkgs; [
|
||||
zlib
|
||||
libpq
|
||||
libsodium
|
||||
];
|
||||
|
||||
hlib = pkgs.haskell.lib;
|
||||
hlib = pkgs.haskell.lib;
|
||||
|
||||
callHackage = {
|
||||
callHackage =
|
||||
{
|
||||
name,
|
||||
version,
|
||||
}: let
|
||||
pkg = pkgs.haskell.packages.ghc910.callHackage name version {};
|
||||
}:
|
||||
let
|
||||
pkg = pkgs.haskell.packages.ghc910.callHackage name version { };
|
||||
in
|
||||
hlib.dontCheck (hlib.doJailbreak pkg);
|
||||
in {
|
||||
name = "flora";
|
||||
packages = with pkgs; let
|
||||
hlib.dontCheck (hlib.doJailbreak pkg);
|
||||
in
|
||||
{
|
||||
name = "flora";
|
||||
packages =
|
||||
with pkgs;
|
||||
let
|
||||
haskellPackages = haskell.packages.ghc910;
|
||||
in
|
||||
# These don't build directly and need to be pinned
|
||||
map callHackage [
|
||||
{
|
||||
name = "fourmolu";
|
||||
version = "0.17.0.0";
|
||||
}
|
||||
{
|
||||
name = "postgresql-migration";
|
||||
version = "0.2.1.8";
|
||||
}
|
||||
]
|
||||
++ [
|
||||
haskellPackages.ghcid
|
||||
haskellPackages.cabal-fmt
|
||||
haskellPackages.cabal-install
|
||||
haskellPackages.ghc
|
||||
haskellPackages.haskell-language-server
|
||||
# These don't build directly and need to be pinned
|
||||
map callHackage [
|
||||
{
|
||||
name = "fourmolu";
|
||||
version = "0.17.0.0";
|
||||
}
|
||||
{
|
||||
name = "postgresql-migration";
|
||||
version = "0.2.1.8";
|
||||
}
|
||||
]
|
||||
++ [
|
||||
haskellPackages.ghcid
|
||||
haskellPackages.cabal-fmt
|
||||
haskellPackages.cabal-install
|
||||
haskellPackages.ghc
|
||||
haskellPackages.haskell-language-server
|
||||
|
||||
postgresql_14
|
||||
postgresqlTestHook
|
||||
postgresql_14
|
||||
postgresqlTestHook
|
||||
|
||||
yarn
|
||||
yarn
|
||||
|
||||
pkg-config
|
||||
esbuild
|
||||
changelog-d
|
||||
]
|
||||
++ libs;
|
||||
pkg-config
|
||||
esbuild
|
||||
changelog-d
|
||||
]
|
||||
++ libs;
|
||||
|
||||
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath libs;
|
||||
})
|
||||
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath libs;
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,20 +1,26 @@
|
|||
{pkgs ? import <nixpkgs> {}}: let
|
||||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
}:
|
||||
let
|
||||
inherit (pkgs) lib;
|
||||
in
|
||||
pkgs.mkShell {
|
||||
name = "forgejo";
|
||||
packages = with pkgs; [
|
||||
gnumake
|
||||
pkgs.mkShell {
|
||||
name = "forgejo";
|
||||
packages = with pkgs; [
|
||||
gnumake
|
||||
|
||||
go
|
||||
golangci-lint
|
||||
gofumpt
|
||||
go
|
||||
golangci-lint
|
||||
gofumpt
|
||||
|
||||
nodejs
|
||||
nodePackages.npm
|
||||
];
|
||||
nodejs
|
||||
nodePackages.npm
|
||||
];
|
||||
|
||||
LD_LIBRARY_PATH = lib.makeLibraryPath (with pkgs; [
|
||||
LD_LIBRARY_PATH = lib.makeLibraryPath (
|
||||
with pkgs;
|
||||
[
|
||||
libuuid
|
||||
]);
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
{pkgs ? import <nixpkgs> {}}:
|
||||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
}:
|
||||
pkgs.mkShell rec {
|
||||
name = "haddock2";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,53 +1,59 @@
|
|||
let
|
||||
sources = import ../../npins;
|
||||
in
|
||||
{pkgs ? import sources.pin-masna3shell {}}:
|
||||
pkgs.mkShell (let
|
||||
libs = with pkgs; [
|
||||
zlib
|
||||
libpq
|
||||
libsodium
|
||||
];
|
||||
{
|
||||
pkgs ? import sources.pin-masna3shell { },
|
||||
}:
|
||||
pkgs.mkShell (
|
||||
let
|
||||
libs = with pkgs; [
|
||||
zlib
|
||||
libpq
|
||||
libsodium
|
||||
];
|
||||
|
||||
hlib = pkgs.haskell.lib;
|
||||
hlib = pkgs.haskell.lib;
|
||||
|
||||
callHackage = {
|
||||
callHackage =
|
||||
{
|
||||
name,
|
||||
version,
|
||||
haskellPackages ? pkgs.haskellPackages,
|
||||
}: let
|
||||
pkg = haskellPackages.callHackage name version {};
|
||||
}:
|
||||
let
|
||||
pkg = haskellPackages.callHackage name version { };
|
||||
in
|
||||
hlib.dontCheck (hlib.doJailbreak pkg);
|
||||
hlib.dontCheck (hlib.doJailbreak pkg);
|
||||
|
||||
haskellPackages = pkgs.haskell.packages.ghc910;
|
||||
in {
|
||||
name = "masna3";
|
||||
packages =
|
||||
[
|
||||
pkgs.haskell.packages.ghc9102.ghc
|
||||
pkgs.haskell.packages.ghc9102.haskell-language-server
|
||||
haskellPackages = pkgs.haskell.packages.ghc910;
|
||||
in
|
||||
{
|
||||
name = "masna3";
|
||||
packages = [
|
||||
pkgs.haskell.packages.ghc9102.ghc
|
||||
pkgs.haskell.packages.ghc9102.haskell-language-server
|
||||
|
||||
haskellPackages.cabal-install
|
||||
haskellPackages.postgresql-migration
|
||||
(callHackage {
|
||||
name = "fourmolu";
|
||||
version = "0.18.0.0";
|
||||
haskellPackages = pkgs.haskell.packages.ghc912;
|
||||
})
|
||||
(callHackage {
|
||||
name = "hlint";
|
||||
version = "3.10";
|
||||
haskellPackages = pkgs.haskell.packages.ghc912;
|
||||
})
|
||||
pkgs.haskell.packages.ghc98.apply-refact
|
||||
haskellPackages.ghc-tags
|
||||
haskellPackages.cabal-gild
|
||||
haskellPackages.cabal-install
|
||||
haskellPackages.postgresql-migration
|
||||
(callHackage {
|
||||
name = "fourmolu";
|
||||
version = "0.18.0.0";
|
||||
haskellPackages = pkgs.haskell.packages.ghc912;
|
||||
})
|
||||
(callHackage {
|
||||
name = "hlint";
|
||||
version = "3.10";
|
||||
haskellPackages = pkgs.haskell.packages.ghc912;
|
||||
})
|
||||
pkgs.haskell.packages.ghc98.apply-refact
|
||||
haskellPackages.ghc-tags
|
||||
haskellPackages.cabal-gild
|
||||
|
||||
pkgs.gnumake
|
||||
pkgs.pkg-config
|
||||
]
|
||||
++ libs;
|
||||
pkgs.gnumake
|
||||
pkgs.pkg-config
|
||||
]
|
||||
++ libs;
|
||||
|
||||
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath libs;
|
||||
})
|
||||
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath libs;
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,37 +1,40 @@
|
|||
let
|
||||
sources = import ../../npins;
|
||||
in
|
||||
{pkgs ? import sources.pin-necro-man-nixpkgs {}}: let
|
||||
shell = {
|
||||
{
|
||||
pkgs ? import sources.pin-necro-man-nixpkgs { },
|
||||
}:
|
||||
let
|
||||
shell =
|
||||
{
|
||||
mkShell,
|
||||
#
|
||||
pkgs,
|
||||
python310Packages,
|
||||
texlive,
|
||||
}:
|
||||
mkShell {
|
||||
name = "necro-manual";
|
||||
packages = [
|
||||
pkgs.emacs
|
||||
python310Packages.pygments
|
||||
mkShell {
|
||||
name = "necro-manual";
|
||||
packages = [
|
||||
pkgs.emacs
|
||||
python310Packages.pygments
|
||||
|
||||
(texlive.combine {
|
||||
inherit
|
||||
(texlive)
|
||||
scheme-medium
|
||||
#
|
||||
wrapfig
|
||||
capt-of
|
||||
minted
|
||||
upquote
|
||||
todonotes
|
||||
fvextra
|
||||
catchfile
|
||||
xstring
|
||||
framed
|
||||
;
|
||||
})
|
||||
];
|
||||
};
|
||||
in
|
||||
pkgs.callPackage shell {}
|
||||
(texlive.combine {
|
||||
inherit (texlive)
|
||||
scheme-medium
|
||||
#
|
||||
wrapfig
|
||||
capt-of
|
||||
minted
|
||||
upquote
|
||||
todonotes
|
||||
fvextra
|
||||
catchfile
|
||||
xstring
|
||||
framed
|
||||
;
|
||||
})
|
||||
];
|
||||
};
|
||||
in
|
||||
pkgs.callPackage shell { }
|
||||
|
|
|
|||
|
|
@ -1,14 +1,16 @@
|
|||
let
|
||||
sources = import ../../npins;
|
||||
in
|
||||
{pkgs ? import sources.pin-vim-tw {}}:
|
||||
pkgs.mkShell {
|
||||
name = "vim-tw";
|
||||
packages = with pkgs; [
|
||||
haskellPackages.cabal-fmt
|
||||
haskellPackages.cabal-install
|
||||
haskellPackages.ghc
|
||||
haskellPackages.haskell-language-server
|
||||
haskellPackages.retrie
|
||||
];
|
||||
}
|
||||
{
|
||||
pkgs ? import sources.pin-vim-tw { },
|
||||
}:
|
||||
pkgs.mkShell {
|
||||
name = "vim-tw";
|
||||
packages = with pkgs; [
|
||||
haskellPackages.cabal-fmt
|
||||
haskellPackages.cabal-install
|
||||
haskellPackages.ghc
|
||||
haskellPackages.haskell-language-server
|
||||
haskellPackages.retrie
|
||||
];
|
||||
}
|
||||
|
|
|
|||
37
nix/disko/hetzner_benchmark/ext4.nix
Normal file
37
nix/disko/hetzner_benchmark/ext4.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/nvme1n1";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
size = "1M";
|
||||
type = "EF02";
|
||||
priority = 1;
|
||||
};
|
||||
ESP = {
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
};
|
||||
root = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
93
nix/disko/hetzner_benchmark/raid.nix
Normal file
93
nix/disko/hetzner_benchmark/raid.nix
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
# I can't get this working for now :(
|
||||
# Only nvme1n1 is detected in the installer environment
|
||||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
one = {
|
||||
type = "disk";
|
||||
device = "/dev/nvme0n1";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
BOOT = {
|
||||
size = "1M";
|
||||
type = "EF02"; # for grub MBR
|
||||
};
|
||||
ESP = {
|
||||
size = "500M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "mdraid";
|
||||
name = "boot";
|
||||
};
|
||||
};
|
||||
mdadm = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "mdraid";
|
||||
name = "raid1";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
two = {
|
||||
type = "disk";
|
||||
device = "/dev/nvme1n1";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
size = "1M";
|
||||
type = "EF02"; # for grub MBR
|
||||
};
|
||||
ESP = {
|
||||
size = "500M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "mdraid";
|
||||
name = "boot";
|
||||
};
|
||||
};
|
||||
mdadm = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "mdraid";
|
||||
name = "raid1";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
mdadm = {
|
||||
boot = {
|
||||
type = "mdadm";
|
||||
level = 1;
|
||||
metadata = "1.0";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
raid1 = {
|
||||
type = "mdadm";
|
||||
level = 1;
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions.primary = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = ["umask=0077"];
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
content = {
|
||||
type = "luks";
|
||||
name = "crypted";
|
||||
extraOpenArgs = [];
|
||||
extraOpenArgs = [ ];
|
||||
settings.allowDiscards = true;
|
||||
content = {
|
||||
type = "lvm_pv";
|
||||
|
|
@ -74,12 +74,15 @@
|
|||
};
|
||||
|
||||
"/home" = {
|
||||
mountOptions = ["compress=zstd"];
|
||||
mountOptions = [ "compress=zstd" ];
|
||||
mountpoint = "/home";
|
||||
};
|
||||
|
||||
"/nix" = {
|
||||
mountOptions = ["compress=zstd" "noatime"];
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
mountpoint = "/nix";
|
||||
};
|
||||
};
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = ["umask=0077"];
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
luks = {
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
content = {
|
||||
type = "luks";
|
||||
name = "crypted";
|
||||
extraOpenArgs = [];
|
||||
extraOpenArgs = [ ];
|
||||
settings = {
|
||||
allowDiscards = true;
|
||||
};
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
mountOptions = ["defaults"];
|
||||
mountOptions = [ "defaults" ];
|
||||
};
|
||||
};
|
||||
nix = {
|
||||
|
|
@ -59,7 +59,7 @@
|
|||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/nix";
|
||||
mountOptions = ["noatime"];
|
||||
mountOptions = [ "noatime" ];
|
||||
};
|
||||
};
|
||||
swap = {
|
||||
|
|
@ -8,13 +8,13 @@
|
|||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
size = "500M";
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = ["umask=0077"];
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -24,64 +24,40 @@
|
|||
content = {
|
||||
type = "luks";
|
||||
name = "crypted";
|
||||
extraOpenArgs = [];
|
||||
extraOpenArgs = [ ];
|
||||
settings.allowDiscards = true;
|
||||
content = {
|
||||
type = "lvm_pv";
|
||||
vg = "pool";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Use LVM to create a partition for swap
|
||||
lvm_vg = {
|
||||
pool = {
|
||||
type = "lvm_vg";
|
||||
lvs = {
|
||||
# Set swap device as resume device
|
||||
swap = {
|
||||
size = "48G"; # > 32G for hibernation
|
||||
content = {
|
||||
type = "swap";
|
||||
discardPolicy = "both";
|
||||
resumeDevice = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Use btrfs over ext4 for:
|
||||
# - compression
|
||||
# nix store can be shrinked using this feature
|
||||
# - more transparent partitions (subvolumes)
|
||||
# no more "I need more space here and not there"
|
||||
btrfs = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "btrfs";
|
||||
|
||||
mountpoint = "/btrfs-root";
|
||||
|
||||
# # DANGER:
|
||||
# # Override existing partition at partition creation
|
||||
# extraArgs = ["-f"];
|
||||
|
||||
subvolumes = {
|
||||
"/root" = {
|
||||
mountOptions = ["noatime"];
|
||||
mountpoint = "/";
|
||||
};
|
||||
|
||||
"/home" = {
|
||||
mountOptions = ["noatime"];
|
||||
mountpoint = "/home";
|
||||
};
|
||||
|
||||
"/nix" = {
|
||||
mountOptions = ["compress=zstd" "noatime"];
|
||||
mountpoint = "/nix";
|
||||
type = "btrfs";
|
||||
# # DANGER:
|
||||
# # Override existing partition at partition creation
|
||||
# extraArgs = ["-f"];
|
||||
subvolumes = {
|
||||
"/root" = {
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
mountpoint = "/";
|
||||
};
|
||||
"/home" = {
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
mountpoint = "/home";
|
||||
};
|
||||
"/nix" = {
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
mountpoint = "/nix";
|
||||
};
|
||||
"/swap" = {
|
||||
mountpoint = "/.swapvol";
|
||||
swap.swapfile.size = "1G";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = ["umask=0077"];
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
luks = {
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
content = {
|
||||
type = "luks";
|
||||
name = "crypted";
|
||||
extraOpenArgs = [];
|
||||
extraOpenArgs = [ ];
|
||||
settings = {
|
||||
allowDiscards = true;
|
||||
};
|
||||
|
|
@ -47,7 +47,7 @@
|
|||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
mountOptions = ["defaults"];
|
||||
mountOptions = [ "defaults" ];
|
||||
};
|
||||
};
|
||||
nix = {
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/nix";
|
||||
mountOptions = ["noatime"];
|
||||
mountOptions = [ "noatime" ];
|
||||
};
|
||||
};
|
||||
swap = {
|
||||
|
|
|
|||
20
nix/git-identities/git-compat.nix
Normal file
20
nix/git-identities/git-compat.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
let
|
||||
hasconfigRemoteCondition =
|
||||
{
|
||||
# Custom arguments
|
||||
url,
|
||||
path ? "*/**",
|
||||
...
|
||||
}@cfg:
|
||||
let
|
||||
cfg' = builtins.removeAttrs cfg [
|
||||
"url"
|
||||
"path"
|
||||
];
|
||||
in
|
||||
[
|
||||
(cfg' // { condition = "hasconfig:remote.*.url:git@${url}:${path}"; })
|
||||
(cfg' // { condition = "hasconfig:remote.*.url:https://${url}/${path}"; })
|
||||
];
|
||||
in
|
||||
builtins.concatMap hasconfigRemoteCondition
|
||||
6
nix/git-identities/hooks/cabal/pre-commit
Executable file
6
nix/git-identities/hooks/cabal/pre-commit
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
make style
|
||||
make doctest
|
||||
make lint
|
||||
57
nix/git-identities/list.nix
Normal file
57
nix/git-identities/list.nix
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
let
|
||||
sources = import ../../npins;
|
||||
lib = import (sources.nixpkgs + "/lib");
|
||||
|
||||
haskellIdentity = {
|
||||
init.defaultBranch = "main";
|
||||
user.name = "Léana Jiang";
|
||||
};
|
||||
|
||||
universityIdentity = {
|
||||
init.defaultBranch = "main";
|
||||
user = {
|
||||
name = "Léana CHIANG";
|
||||
email = "leana.chiang@etudiant.univ-rennes1.fr";
|
||||
signingKey = "0x32035DB97E777EEB";
|
||||
};
|
||||
};
|
||||
|
||||
blameIgnore = {
|
||||
blame.ignoreRevsFile = ".git-blame-ignore-revs";
|
||||
};
|
||||
in
|
||||
[
|
||||
# Univ stuff
|
||||
{
|
||||
url = "gitlab.istic.univ-rennes1.fr";
|
||||
contents = universityIdentity;
|
||||
}
|
||||
{
|
||||
url = "gitlab2.istic.univ-rennes1.fr";
|
||||
contents = universityIdentity;
|
||||
}
|
||||
|
||||
# Haskell
|
||||
{
|
||||
url = "gitlab.haskell.org";
|
||||
contents = haskellIdentity;
|
||||
}
|
||||
|
||||
# Blame
|
||||
# Turning this on globally will fail if the file doesn't exist
|
||||
{
|
||||
url = "github.com";
|
||||
path = "nixos/nixpkgs.git";
|
||||
contents = blameIgnore;
|
||||
}
|
||||
{
|
||||
url = "gitlab.haskell.org";
|
||||
path = "ghc/ghc.git";
|
||||
contents = blameIgnore;
|
||||
}
|
||||
{
|
||||
url = "github.com";
|
||||
path = "haskell/cabal.git";
|
||||
contents = blameIgnore;
|
||||
}
|
||||
]
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
programs.atuin = {
|
||||
flags = ["--disable-up-arrow"];
|
||||
flags = [ "--disable-up-arrow" ];
|
||||
settings = {
|
||||
history_filter = [
|
||||
# privacy
|
||||
|
|
|
|||
|
|
@ -145,9 +145,10 @@ background_update = True
|
|||
#* Custom cpu model name, empty string to disable.
|
||||
custom_cpu_name = ""
|
||||
|
||||
# TODO: maybe move this to vanadium because it's host based
|
||||
#* Optional filter for shown disks, should be full path of a mountpoint, separate multiple values with whitespace " ".
|
||||
#* Begin line with "exclude=" to change to exclude filter, otherwise defaults to "most include" filter. Example: disks_filter="exclude=/boot /home/user".
|
||||
disks_filter = "exclude=/btrfs-root /nix /home /boot"
|
||||
disks_filter = "exclude=/nix /home /boot /.swapvol"
|
||||
|
||||
#* Show graphs instead of meters for memory values.
|
||||
mem_graphs = True
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{config, ...}: {
|
||||
{ config, ... }:
|
||||
{
|
||||
programs.btop = {
|
||||
settings.color_theme = "${config.programs.btop.package}/share/btop/themes/onedark.theme";
|
||||
extraConfig = builtins.readFile ./btop.conf;
|
||||
|
|
|
|||
|
|
@ -2,49 +2,51 @@
|
|||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
programs.cmus.extraConfig = let
|
||||
# dispatch to multiple callbacks
|
||||
callback-script = pkgs.writeShellApplication {
|
||||
name = "cmus-callback-script";
|
||||
runtimeInputs = [
|
||||
pkgs.cmusfm
|
||||
pkgs.libnotify
|
||||
];
|
||||
text = ''
|
||||
# All keys contain only chars a-z. Values are UTF-8 strings.
|
||||
#
|
||||
# Keys: status file url artist album discnumber tracknumber title date
|
||||
# - status (stopped, playing, paused) is always given
|
||||
# - file or url is given only if track is 'loaded' in cmus
|
||||
# - other keys/values are given only if they are available
|
||||
}:
|
||||
{
|
||||
programs.cmus.extraConfig =
|
||||
let
|
||||
# dispatch to multiple callbacks
|
||||
callback-script = pkgs.writeShellApplication {
|
||||
name = "cmus-callback-script";
|
||||
runtimeInputs = [
|
||||
pkgs.cmusfm
|
||||
pkgs.libnotify
|
||||
];
|
||||
text = ''
|
||||
# All keys contain only chars a-z. Values are UTF-8 strings.
|
||||
#
|
||||
# Keys: status file url artist album discnumber tracknumber title date
|
||||
# - status (stopped, playing, paused) is always given
|
||||
# - file or url is given only if track is 'loaded' in cmus
|
||||
# - other keys/values are given only if they are available
|
||||
|
||||
# Use a map so that we can redirect all the args to cmusfm
|
||||
argv=("$@")
|
||||
declare -A map
|
||||
while [ $# -gt 0 ]; do
|
||||
map["$1"]="$2"
|
||||
shift
|
||||
shift
|
||||
done
|
||||
# Use a map so that we can redirect all the args to cmusfm
|
||||
argv=("$@")
|
||||
declare -A map
|
||||
while [ $# -gt 0 ]; do
|
||||
map["$1"]="$2"
|
||||
shift
|
||||
shift
|
||||
done
|
||||
|
||||
# Setup pretty symbols
|
||||
case ''${map[status]} in
|
||||
paused)
|
||||
SYMB="⏸"
|
||||
;;
|
||||
playing)
|
||||
SYMB="⏵"
|
||||
;;
|
||||
esac
|
||||
# Setup pretty symbols
|
||||
case ''${map[status]} in
|
||||
paused)
|
||||
SYMB="⏸"
|
||||
;;
|
||||
playing)
|
||||
SYMB="⏵"
|
||||
;;
|
||||
esac
|
||||
|
||||
notify-send \
|
||||
"$SYMB ''${map[title]}" \
|
||||
"''${map[artist]} / ''${map[album]}"
|
||||
cmusfm "''${argv[@]}"
|
||||
'';
|
||||
};
|
||||
in
|
||||
notify-send \
|
||||
"$SYMB ''${map[title]}" \
|
||||
"''${map[artist]} / ''${map[album]}"
|
||||
cmusfm "''${argv[@]}"
|
||||
'';
|
||||
};
|
||||
in
|
||||
builtins.readFile ./rc
|
||||
+ lib.optionalString pkgs.stdenv.isLinux ''
|
||||
set status_display_program=${lib.getExe callback-script}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{config, ...}: {
|
||||
{ config, ... }:
|
||||
{
|
||||
programs.direnv = {
|
||||
nix-direnv.enable = true;
|
||||
config = {
|
||||
|
|
|
|||
|
|
@ -3,12 +3,14 @@
|
|||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
cfg = config.i18n.inputMethod;
|
||||
in {
|
||||
in
|
||||
{
|
||||
i18n.inputMethod = {
|
||||
fcitx5.addons = [
|
||||
pkgs.fcitx5-chinese-addons
|
||||
pkgs.qt6Packages.fcitx5-chinese-addons
|
||||
pkgs.fcitx5-table-extra
|
||||
];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -27,12 +27,6 @@ EnumerateWithTriggerKeys=true
|
|||
[Hotkey/AltTriggerKeys]
|
||||
0=Shift_L
|
||||
|
||||
[Hotkey/EnumerateGroupBackwardKeys]
|
||||
0=Control+Shift+space
|
||||
|
||||
[Hotkey/EnumerateGroupForwardKeys]
|
||||
0=Control+space
|
||||
|
||||
[Hotkey/NextCandidate]
|
||||
0=Tab
|
||||
|
||||
|
|
@ -46,3 +40,4 @@ EnumerateWithTriggerKeys=true
|
|||
0=Up
|
||||
|
||||
[Hotkey/TriggerKeys]
|
||||
0=Control+space
|
||||
|
|
|
|||
|
|
@ -1,23 +1,16 @@
|
|||
# vim:ft=ini
|
||||
|
||||
[GroupOrder]
|
||||
0=gDvorak
|
||||
1=gCangjie
|
||||
0="Group 1"
|
||||
|
||||
[Groups/0]
|
||||
Name="Group 1"
|
||||
Default Layout=us-dvorak
|
||||
DefaultIM=keyboard-us-dvorak
|
||||
Name=gDvorak
|
||||
|
||||
[Groups/0/Items/0]
|
||||
Layout=
|
||||
Name=keyboard-us-dvorak
|
||||
Layout=us-dvorak
|
||||
|
||||
[Groups/1]
|
||||
Default Layout=us
|
||||
DefaultIM=cangjie3
|
||||
Name=gCangjie
|
||||
|
||||
[Groups/1/Items/0]
|
||||
Layout=
|
||||
[Groups/0/Items/1]
|
||||
Name=cangjie3
|
||||
Layout=us
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
SecondCandidate=
|
||||
# Select Third Candidate
|
||||
ThirdCandidate=
|
||||
# Page size
|
||||
# Candidates Per Page
|
||||
PageSize=10
|
||||
# Commit after auto select candidates
|
||||
CommitAfterSelect=True
|
||||
|
|
|
|||
|
|
@ -3,11 +3,13 @@
|
|||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
inherit (pkgs) nur;
|
||||
|
||||
cfg = config.programs.firefox;
|
||||
in {
|
||||
in
|
||||
{
|
||||
programs.firefox = {
|
||||
# https://mozilla.github.io/policy-templates
|
||||
# The following have more complex logic, keep them as policies and not profiles
|
||||
|
|
@ -19,7 +21,21 @@ in {
|
|||
];
|
||||
|
||||
SearchEngines = {
|
||||
Remove = ["Bing" "DuckDuckGo" "Qwant" "eBay"];
|
||||
Remove = [
|
||||
"Google"
|
||||
"Bing"
|
||||
"DuckDuckGo"
|
||||
"Qwant"
|
||||
"eBay"
|
||||
"Perplexity"
|
||||
];
|
||||
Default = "DuckDuckGo Lite";
|
||||
Add = [
|
||||
{
|
||||
Name = "DuckDuckGo Lite";
|
||||
URLTemplate = "https://lite.duckduckgo.com/lite/search?q={searchTerms}";
|
||||
}
|
||||
];
|
||||
};
|
||||
NoDefaultBookmarks = true;
|
||||
DisplayMenuBar = "never";
|
||||
|
|
@ -38,6 +54,10 @@ in {
|
|||
"browser.ctrlTab.sortByRecentlyUsed" = false;
|
||||
"layout.css.devPixelsPerPx" = 1.1;
|
||||
|
||||
# open links in new window
|
||||
# this works a lot better with xmonad where I have a bunch of windows
|
||||
"browser.link.open_newwindow" = 2;
|
||||
|
||||
# Sponsored crap
|
||||
# Yes
|
||||
"browser.newtabpage.activity-stream.showSearch" = true;
|
||||
|
|
@ -85,35 +105,42 @@ in {
|
|||
"media.peerconnection.enabled" = false;
|
||||
};
|
||||
|
||||
extensions.packages = let
|
||||
addons = nur.repos.rycee.firefox-addons;
|
||||
in [
|
||||
addons.ublock-origin
|
||||
addons.privacy-badger
|
||||
addons.user-agent-string-switcher
|
||||
extensions.packages =
|
||||
let
|
||||
addons = nur.repos.rycee.firefox-addons;
|
||||
in
|
||||
[
|
||||
addons.ublock-origin
|
||||
addons.privacy-badger
|
||||
addons.user-agent-string-switcher
|
||||
|
||||
/*
|
||||
Here's to you who want to remove news feed eradicator because you find it annoying:
|
||||
It is here to annoy you so it is less likely for you to be on the agency inversion path.
|
||||
DO NOT REMOVE IT. I repeat, DO NOT REMOVE IT.
|
||||
/*
|
||||
Here's to you who want to remove news feed eradicator because you find it annoying:
|
||||
It is here to annoy you so it is less likely for you to be on the agency inversion path.
|
||||
DO NOT REMOVE IT. I repeat, DO NOT REMOVE IT.
|
||||
|
||||
If you think it's annoying, go do some jump rope, sing, live.
|
||||
*/
|
||||
addons.news-feed-eradicator # did you read the comment above?
|
||||
addons.multi-account-containers
|
||||
];
|
||||
If you think it's annoying, go do some jump rope, sing, live.
|
||||
*/
|
||||
addons.news-feed-eradicator # did you read the comment above?
|
||||
addons.multi-account-containers
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
xdg.mimeApps = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
# source: https://unix.stackexchange.com/a/684582
|
||||
defaultApplications = {
|
||||
"text/html" = "firefox.desktop";
|
||||
"x-scheme-handler/http" = "firefox.desktop";
|
||||
"x-scheme-handler/https" = "firefox.desktop";
|
||||
"x-scheme-handler/about" = "firefox.desktop";
|
||||
"x-scheme-handler/unknown" = "firefox.desktop";
|
||||
xdg.mimeApps =
|
||||
let
|
||||
# source: https://unix.stackexchange.com/a/684582
|
||||
associations = {
|
||||
"text/html" = "firefox.desktop";
|
||||
"x-scheme-handler/http" = "firefox.desktop";
|
||||
"x-scheme-handler/https" = "firefox.desktop";
|
||||
"x-scheme-handler/about" = "firefox.desktop";
|
||||
"x-scheme-handler/unknown" = "firefox.desktop";
|
||||
};
|
||||
in
|
||||
lib.mkIf (cfg.enable && !config.programs.zen-browser.enable) {
|
||||
enable = true;
|
||||
associations.added = associations;
|
||||
defaultApplications = associations;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
programs.fish = {
|
||||
shellAbbrs = lib.mkMerge [
|
||||
(lib.mkIf pkgs.stdenv.isLinux {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./aliasesAbbrs.nix
|
||||
];
|
||||
|
|
@ -10,7 +11,7 @@
|
|||
#
|
||||
# Script dependencies
|
||||
#
|
||||
home.packages = [pkgs.vivid];
|
||||
home.packages = [ pkgs.vivid ];
|
||||
programs = {
|
||||
fd.enable = true;
|
||||
fzf.enable = true;
|
||||
|
|
@ -24,11 +25,9 @@
|
|||
#
|
||||
# Scripts and functions
|
||||
#
|
||||
xdg.configFile =
|
||||
lib.mapAttrs'
|
||||
(path: _:
|
||||
lib.nameValuePair "fish/functions/${path}" {source = "${./functions}/${path}";})
|
||||
(builtins.readDir ./functions);
|
||||
xdg.configFile = lib.mapAttrs' (
|
||||
path: _: lib.nameValuePair "fish/functions/${path}" { source = "${./functions}/${path}"; }
|
||||
) (builtins.readDir ./functions);
|
||||
|
||||
programs.fish = {
|
||||
interactiveShellInit = builtins.readFile ./shellInit.fish;
|
||||
|
|
|
|||
|
|
@ -18,34 +18,33 @@ set fish_cursor_visual block
|
|||
###############
|
||||
# Learn more: https://fishshell.com/docs/current/interactive.html
|
||||
begin # scope this in a block to not leak variables everywhere
|
||||
set -l black \#000000
|
||||
set -l grey \#a0a1a7
|
||||
set -l cyan \#0184bc
|
||||
set -l blue \#4078f2
|
||||
set -l purple \#a626a4
|
||||
set -l green \#50a14f
|
||||
set -l orange \#e45649
|
||||
set -l red \#ca1243
|
||||
set -l brown \#986801
|
||||
set -l gold \#c18401
|
||||
set -l accent \#645199
|
||||
set -l visual \#d0d0d0
|
||||
set -l black "#073642" # .hs-identifier
|
||||
set -l grey "#a0a1a7"
|
||||
set -l cyan "#2aa198" # .hs-pragma
|
||||
set -l blue "#268bd2" # .hs-number
|
||||
set -l magenta "#d33682" # .hs-operator
|
||||
set -l green "#859900" # .hs-cpp
|
||||
set -l orange "#cb4b16" # .hs-char
|
||||
set -l red "#af005f" # .hs-special
|
||||
set -l purple "#5f5faf" # .hs-type
|
||||
set -l visual "#dbcba3"
|
||||
set -l cursor "#f0e5c9"
|
||||
|
||||
# General
|
||||
set fish_color_normal $black # default color
|
||||
set fish_color_command $blue # commands like echo
|
||||
set fish_color_keyword $purple # keywords like if - this falls back on the command color if unset
|
||||
set fish_color_quote $green # quoted text like "abc"
|
||||
set fish_color_redirection $gold # IO redirections like >/dev/null
|
||||
set fish_color_end $black --bold # process separators like ; and &
|
||||
set fish_color_error $black # syntax errors
|
||||
set fish_color_param $red # ordinary command parameters
|
||||
set fish_color_command # commands like echo
|
||||
set fish_color_keyword $red # keywords like if - this falls back on the command color if unset
|
||||
set fish_color_quote $orange # quoted text like "abc"
|
||||
set fish_color_redirection $magenta # IO redirections like >/dev/null
|
||||
set fish_color_end $magenta --bold # process separators like ; and &
|
||||
set fish_color_error $grey # syntax errors
|
||||
set fish_color_param $black # ordinary command parameters
|
||||
set fish_color_valid_path --italics # parameters that are filenames (if the file exists)
|
||||
set fish_color_option $cyan # options starting with “-”, up to the first “--” parameter
|
||||
set fish_color_option # options starting with “-”, up to the first “--” parameter
|
||||
set fish_color_comment $grey # comments like ‘# important’
|
||||
set fish_color_selection --background=$visual # selected text in vi visual mode
|
||||
set fish_color_operator $orange # parameter expansion operators like * and ~
|
||||
set fish_color_escape $purple # character escapes like \n and \x70
|
||||
set fish_color_operator $magenta # parameter expansion operators like * and ~
|
||||
set fish_color_escape $orange # character escapes like \n and \x70
|
||||
set fish_color_autosuggestion $grey # autosuggestions (the proposed rest of a command)
|
||||
set fish_color_cwd $black # The current working directory in the default prompt
|
||||
set fish_color_cwd_root $red # The current working directory in the default prompt for the root user
|
||||
|
|
@ -53,19 +52,19 @@ begin # scope this in a block to not leak variables everywhere
|
|||
set fish_color_host $black # The hostname in the default prompt
|
||||
set fish_color_host_remote $red # the hostname in the default prompt for remote sessions (like ssh)
|
||||
set fish_color_status $red # the last command’s nonzero exit code in the default prompt
|
||||
set fish_color_cancel $accent --reverse # the ‘^C’ indicator on a canceled command
|
||||
set fish_color_search_match --background $visual # history search matches and selected pager items (background only)
|
||||
set fish_color_cancel $cyan --reverse # the ‘^C’ indicator on a canceled command
|
||||
set fish_color_search_match --background=$cursor # history search matches and selected pager items (background only)
|
||||
|
||||
# Pager
|
||||
set fish_pager_color_progress --reverse $cyan # the progress bar at the bottom left corner
|
||||
set fish_pager_color_background $black # the background color of a line
|
||||
set fish_pager_color_prefix $black # the prefix string, i.e. the string that is to be completed
|
||||
set fish_pager_color_completion $grey # the completion itself, i.e. the proposed rest of the string
|
||||
set fish_pager_color_description $grey # the completion description
|
||||
set fish_pager_color_selected_background $black # background of the selected completion
|
||||
set fish_pager_color_selected_prefix # prefix of the selected completion
|
||||
set fish_pager_color_selected_completion $red # suffix of the selected completion
|
||||
set fish_pager_color_selected_description $gold # description of the selected completion
|
||||
set fish_pager_color_progress --reverse # the progress bar at the bottom left corner
|
||||
set fish_pager_color_background # the background color of a line
|
||||
set fish_pager_color_prefix $black # the prefix string, i.e. the string that is to be completed
|
||||
set fish_pager_color_completion $grey # the completion itself, i.e. the proposed rest of the string
|
||||
set fish_pager_color_description $grey # the completion description
|
||||
set fish_pager_color_selected_background --background=$cursor # background of the selected completion
|
||||
set fish_pager_color_selected_prefix $black # prefix of the selected completion
|
||||
set fish_pager_color_selected_completion $black # suffix of the selected completion
|
||||
set fish_pager_color_selected_description $black # description of the selected completion
|
||||
|
||||
# # Alternating colors
|
||||
# set fish_pager_color_secondary_background --background=$tinted_bg # background of every second unselected completion
|
||||
|
|
@ -81,8 +80,10 @@ end
|
|||
set -x fzf_preview_file_cmd 'cat -n'
|
||||
# fzf-fish search hidden files
|
||||
set -x fzf_fd_opts --hidden --exclude=.git
|
||||
# fzf-fish using patdiff would show incomplete diff, it is a bug
|
||||
# don't do it
|
||||
|
||||
# fd uses LS_COLORS
|
||||
set -x LS_COLORS (vivid -m 24-bit generate one-light)
|
||||
set -x LS_COLORS (vivid -m 24-bit generate solarized-light) # similar to milou
|
||||
|
||||
set -g sponge_purge_only_on_exit true
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
"--cycle"
|
||||
"--border=none"
|
||||
"--preview-window=wrap"
|
||||
"--color=fg:#000000,bg:#eeeeee,hl:#ca1243"
|
||||
"--color=fg+:#000000,bg+:#d0d0d0,hl+:#ca1243"
|
||||
"--color=info:#0184bc,prompt:#645199,pointer:#645199"
|
||||
"--color=marker:#0184bc,spinner:#645199,header:#645199"
|
||||
"--color=gutter:#eeeeee"
|
||||
"--color=fg:#073642,bg:#fdf6e3,hl:#af005f"
|
||||
"--color=fg+:#073642,bg+:#f0e5c9,hl+:#af005f"
|
||||
"--color=info:#268bd2,prompt:#5f5faf,pointer:#073642"
|
||||
"--color=marker:#268bd2,spinner:#5f5faf,header:#073642"
|
||||
"--color=gutter:#eeeadd"
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,17 +2,19 @@
|
|||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
# git plugins
|
||||
programs.git = {
|
||||
lfs.enable = true;
|
||||
patdiff.enable = true;
|
||||
programs.patdiff = {
|
||||
enable = lib.mkDefault true;
|
||||
enableGitIntegration = lib.mkDefault true;
|
||||
};
|
||||
|
||||
# 懶惰鬼賴皮
|
||||
programs.lazygit = let
|
||||
patdiffCfg = config.programs.git.patdiff;
|
||||
in
|
||||
programs.lazygit =
|
||||
let
|
||||
patdiffCfg = config.programs.patdiff;
|
||||
in
|
||||
lib.mkIf patdiffCfg.enable {
|
||||
settings = {
|
||||
git.paging.externalDiffCommand = "${lib.getExe' patdiffCfg.package "patdiff-git-wrapper"}";
|
||||
|
|
@ -21,7 +23,7 @@
|
|||
|
||||
# git itself
|
||||
programs.git = {
|
||||
extraConfig = {
|
||||
settings = {
|
||||
init.defaultBranch = "trunk"; # I like trees
|
||||
push.autoSetupRemote = true;
|
||||
pull.ff = "only";
|
||||
|
|
@ -49,9 +51,9 @@
|
|||
};
|
||||
|
||||
# identity
|
||||
programs.git = {
|
||||
userEmail = "leana.jiang+git@icloud.com";
|
||||
userName = "Léana 江";
|
||||
programs.git.settings = {
|
||||
user.email = "leana.jiang+git@icloud.com";
|
||||
user.name = "Léana 江";
|
||||
signing = {
|
||||
key = "0x4E887A4CA9714ADA";
|
||||
signByDefault = lib.mkDefault false;
|
||||
|
|
|
|||
|
|
@ -1,25 +1,27 @@
|
|||
{pkgs, ...}: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
services = {
|
||||
gpg-agent.defaultCacheTtl = 1209600;
|
||||
gpg-agent.pinentry.package = pkgs.pinentry-tty;
|
||||
};
|
||||
|
||||
programs.gpg.publicKeys = let
|
||||
fromUrl = {
|
||||
url,
|
||||
hash,
|
||||
trust ? 5,
|
||||
}: {
|
||||
source = pkgs.fetchurl {inherit url hash;};
|
||||
inherit trust;
|
||||
};
|
||||
programs.gpg.publicKeys =
|
||||
let
|
||||
fromUrl =
|
||||
{
|
||||
url,
|
||||
hash,
|
||||
trust ? 5,
|
||||
}:
|
||||
{
|
||||
source = pkgs.fetchurl { inherit url hash; };
|
||||
inherit trust;
|
||||
};
|
||||
|
||||
github = {user, ...} @ args:
|
||||
fromUrl (
|
||||
builtins.removeAttrs args ["user"]
|
||||
// {url = "https://github.com/${user}.gpg";}
|
||||
);
|
||||
in
|
||||
github =
|
||||
{ user, ... }@args:
|
||||
fromUrl (builtins.removeAttrs args [ "user" ] // { url = "https://github.com/${user}.gpg"; });
|
||||
in
|
||||
map github [
|
||||
# Do not depend on my own forgejo instance / self-host server to avoid a single point of failure
|
||||
{
|
||||
|
|
@ -42,6 +44,10 @@
|
|||
user = "confusedkernel";
|
||||
hash = "sha256-9DdtDAcv+2Z0jJMSLAXbp5ne8uHYj5V/lNGi0kKSdv4=";
|
||||
}
|
||||
{
|
||||
user = "gautaz";
|
||||
hash = "sha256-j0I9l8uKfzKNrc2qveFi5mkRppxL36+BUEqvFPs6vqA=";
|
||||
}
|
||||
]
|
||||
++ map fromUrl [
|
||||
{
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue