Compare commits

..

18 commits

Author SHA1 Message Date
Bruno BELANYI 0fb2ed977e flake: home-manager: export NixOS homes
All checks were successful
ci/woodpecker/push/check Pipeline was successful
And here is what the last few commits were building up to.

This is neat, but won't be useful *very* often.
2024-01-03 22:17:12 +00:00
Bruno BELANYI c593180cf2 flake: home-manager: refactor 'mkHome'
This will allow making a similar function for NixOS homes.
2024-01-03 22:17:12 +00:00
Bruno BELANYI d94c9da1c1 flake: home-manager: use 'hosts' option 2024-01-03 22:17:12 +00:00
Bruno BELANYI e33357f72e flake: nixos: use 'hosts' option 2024-01-03 22:17:12 +00:00
Bruno BELANYI dd7134ca3e flake: add hosts
This will allow other modules to cross-reference which hosts exist on
which system.

My main use-case is to automatically declare home-manager configuration
for the home configuration of NixOS hosts.

I also include Darwin in case I ever want to use that in the future,
though that is unlikely for the moment.
2024-01-03 22:17:12 +00:00
Bruno BELANYI 33a7d0a141 hosts: nixos: porthos: add profiles 2024-01-03 22:17:12 +00:00
Bruno BELANYI 272a8fb7b9 common: profiles: forward profiles to home-manager
We can only do this now that every profile has been migrated, otherwise
we would get errors about undeclared modules... It's not perfect, but
it's good enough.

This is only done for `type == "nixos"` for now, as I don't have any
Darwin configurations...
2024-01-03 22:17:12 +00:00
Bruno BELANYI ad17fed0bf common: profiles: migrate X 2024-01-03 22:17:12 +00:00
Bruno BELANYI 334a3346b8 common: profiles: migrate wm 2024-01-03 22:17:12 +00:00
Bruno BELANYI 53594d2fb4 common: profiles: migrate laptop 2024-01-03 22:17:12 +00:00
Bruno BELANYI 9f82f2a7e8 common: profiles: migrate gtk 2024-01-03 22:17:12 +00:00
Bruno BELANYI ac03fb3b31 common: profiles: migrate devices 2024-01-03 22:17:12 +00:00
Bruno BELANYI 034cd3ac55 common: profiles: migrate bluetooth 2024-01-03 22:17:12 +00:00
Bruno BELANYI 2027bb327e common: add profiles
I will be migrating each sub-module one by one.
2024-01-03 22:17:12 +00:00
Bruno BELANYI 61c234d932 flake: nixos: import common modules 2024-01-03 22:17:12 +00:00
Bruno BELANYI fe6df44b85 flake: home-manager: import common modules 2024-01-03 22:17:12 +00:00
Bruno BELANYI d113742905 nixos: home: import common modules 2024-01-03 22:17:12 +00:00
Bruno BELANYI aa1336bb8d modules: add common
This should define modules that are identical, or very similar.

The driving force is to be able to use `my.profiles` on home-manager and NixOS
without repeating myself.

In the future I might migrate other modules, such as `nixos/system/nix`...
2024-01-03 16:51:38 +00:00
200 changed files with 1538 additions and 2677 deletions

View file

@ -7,17 +7,17 @@ steps:
commands: commands:
- nix flake check - nix flake check
- name: notify - name: notifiy
image: bash image: bash
environment: secrets:
ADDRESS: - source: matrix_homeserver
from_secret: matrix_homeserver target: address
ROOM: - source: matrix_roomid
from_secret: matrix_roomid target: room
USER: - source: matrix_username
from_secret: matrix_username target: user
PASS: - source: matrix_password
from_secret: matrix_password target: pass
commands: commands:
- nix run '.#matrix-notifier' - nix run '.#matrix-notifier'
when: when:

View file

@ -14,11 +14,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1723293904, "lastModified": 1703433843,
"narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=", "narHash": "sha256-nmtA4KqFboWxxoOAA6Y1okHbZh+HsXaMPFkYHsoDRDw=",
"owner": "ryantm", "owner": "ryantm",
"repo": "agenix", "repo": "agenix",
"rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41", "rev": "417caa847f9383e111d1397039c9d4337d024bf0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -53,11 +53,11 @@
"flake-compat": { "flake-compat": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1696426674, "lastModified": 1673956053,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra", "owner": "edolstra",
"repo": "flake-compat", "repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -73,11 +73,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733312601, "lastModified": 1704152458,
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", "narHash": "sha256-DS+dGw7SKygIWf9w4eNBUZsK+4Ug27NwEWmn2tnbycg=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", "rev": "88a2cd8166694ba0b6cb374700799cec53aef527",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -94,11 +94,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1731533236, "lastModified": 1701680307,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -116,11 +116,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1709087332, "lastModified": 1660459072,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "gitignore.nix", "repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394", "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -136,11 +136,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1734808199, "lastModified": 1704276313,
"narHash": "sha256-MxlUcLjE8xLbrI1SJ2B2jftlg4wdutEILa3fgqwA98I=", "narHash": "sha256-4eD4RaAKHLj0ztw5pQcNFs3hGpxrsYb0e9Qir+Ute+w=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "f342df3ad938f205a913973b832f52c12546aac6", "rev": "4d8f90205c6c90be2e81d94d0e5eedf71c1ba34e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -152,11 +152,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1734424634, "lastModified": 1703961334,
"narHash": "sha256-cHar1vqHOOyC7f1+tVycPoWTfKIaqkoe1Q6TnKzuti4=", "narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d3c42f187194c26d9f0309a8ecc469d6c878ce33", "rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -167,21 +167,12 @@
} }
}, },
"nur": { "nur": {
"inputs": {
"flake-parts": [
"flake-parts"
],
"nixpkgs": [
"nixpkgs"
],
"treefmt-nix": "treefmt-nix"
},
"locked": { "locked": {
"lastModified": 1734810357, "lastModified": 1704289500,
"narHash": "sha256-Oa6d+y1/PVaPrZ/GYwvmTK9kSrc5Qx/8D3DFN2TzpVA=", "narHash": "sha256-SMoojjdEMgf6GtPh5vzofdeev4nyM+vBi2J6Z/Sufco=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "e7b7b92a7c97a91f1465ab433bbdf6d00df1db8e", "rev": "a18213c74e43dd6e941c41d77382377938c77caf",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -194,6 +185,9 @@
"pre-commit-hooks": { "pre-commit-hooks": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-utils": [
"futils"
],
"gitignore": "gitignore", "gitignore": "gitignore",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
@ -203,11 +197,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1734797603, "lastModified": 1703939133,
"narHash": "sha256-ulZN7ps8nBV31SE+dwkDvKIzvN6hroRY8sYOT0w+E28=", "narHash": "sha256-Gxe+mfOT6bL7wLC/tuT2F+V+Sb44jNr8YsJ3cyIl4Mo=",
"owner": "cachix", "owner": "cachix",
"repo": "pre-commit-hooks.nix", "repo": "pre-commit-hooks.nix",
"rev": "f0f0dc4920a903c3e08f5bdb9246bb572fcae498", "rev": "9d3d7e18c6bc4473d7520200d4ddab12f8402d38",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -244,27 +238,6 @@
"repo": "default", "repo": "default",
"type": "github" "type": "github"
} }
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"nur",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733222881,
"narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "49717b5af6f80172275d47a418c9719a31a78b53",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -55,10 +55,6 @@
owner = "nix-community"; owner = "nix-community";
repo = "NUR"; repo = "NUR";
ref = "master"; ref = "master";
inputs = {
flake-parts.follows = "flake-parts";
nixpkgs.follows = "nixpkgs";
};
}; };
pre-commit-hooks = { pre-commit-hooks = {
@ -67,6 +63,7 @@
repo = "pre-commit-hooks.nix"; repo = "pre-commit-hooks.nix";
ref = "master"; ref = "master";
inputs = { inputs = {
flake-utils.follows = "futils";
nixpkgs.follows = "nixpkgs"; nixpkgs.follows = "nixpkgs";
nixpkgs-stable.follows = "nixpkgs"; nixpkgs-stable.follows = "nixpkgs";
}; };

View file

@ -1,9 +1,9 @@
{ flake-parts { flake-parts
, systems , futils
, ... , ...
} @ inputs: } @ inputs:
let let
mySystems = import systems; mySystems = futils.lib.defaultSystems;
in in
flake-parts.lib.mkFlake { inherit inputs; } { flake-parts.lib.mkFlake { inherit inputs; } {
systems = mySystems; systems = mySystems;
@ -13,6 +13,7 @@ flake-parts.lib.mkFlake { inherit inputs; } {
./checks.nix ./checks.nix
./dev-shells.nix ./dev-shells.nix
./home-manager.nix ./home-manager.nix
./hosts.nix
./lib.nix ./lib.nix
./nixos.nix ./nixos.nix
./overlays.nix ./overlays.nix

View file

@ -1,5 +1,7 @@
{ self, inputs, lib, ... }: { self, config, inputs, lib, ... }:
let let
inherit (config) hosts;
defaultModules = [ defaultModules = [
# Include generic settings # Include generic settings
"${self}/modules/home" "${self}/modules/home"
@ -14,9 +16,11 @@ let
# Enable home-manager # Enable home-manager
programs.home-manager.enable = true; programs.home-manager.enable = true;
} }
# Import common modules
"${self}/modules/common"
]; ];
mkHome = name: system: inputs.home-manager.lib.homeManagerConfiguration { mkHomeCommon = mainModules: system: inputs.home-manager.lib.homeManagerConfiguration {
# Work-around for home-manager # Work-around for home-manager
# * not letting me set `lib` as an extraSpecialArgs # * not letting me set `lib` as an extraSpecialArgs
# * not respecting `nixpkgs.overlays` [1] # * not respecting `nixpkgs.overlays` [1]
@ -25,38 +29,55 @@ let
inherit system; inherit system;
overlays = (lib.attrValues self.overlays) ++ [ overlays = (lib.attrValues self.overlays) ++ [
inputs.nur.overlays.default inputs.nur.overlay
]; ];
}; };
modules = defaultModules ++ [ modules = defaultModules ++ mainModules;
"${self}/hosts/homes/${name}"
];
extraSpecialArgs = { extraSpecialArgs = {
# Inject inputs to use them in global registry # Inject inputs to use them in global registry
inherit inputs; inherit inputs;
# For consumption by common modules
type = "home";
}; };
}; };
homes = { mkHome = name: mkHomeCommon [ "${self}/hosts/homes/${name}" ];
mkNixosHome = name: mkHomeCommon [
"${self}/hosts/nixos/${name}/home.nix"
"${self}/hosts/nixos/${name}/profiles.nix"
];
in
{
hosts.homes = {
"ambroisie@bazin" = "x86_64-linux"; "ambroisie@bazin" = "x86_64-linux";
"ambroisie@mousqueton" = "x86_64-linux"; "ambroisie@mousqueton" = "x86_64-linux";
}; };
in
{
perSystem = { system, ... }: { perSystem = { system, ... }: {
# Work-around for https://github.com/nix-community/home-manager/issues/3075 # Work-around for https://github.com/nix-community/home-manager/issues/3075
legacyPackages = { legacyPackages = {
homeConfigurations = homeConfigurations =
let let
filteredHomes = lib.filterAttrs (_: v: v == system) homes; filteredHomes = lib.filterAttrs (_: v: v == system) hosts.homes;
allHomes = filteredHomes // { allHomes = filteredHomes // {
# Default configuration # Default configuration
ambroisie = system; ambroisie = system;
}; };
homeManagerHomes = lib.mapAttrs mkHome allHomes;
filteredNixosHosts = lib.filterAttrs (_: v: v == system) hosts.nixos;
nixosHomes' = lib.mapAttrs mkNixosHome filteredNixosHosts;
nixosHomeUsername = (host: self.nixosConfigurations.${host}.config.my.user.name);
nixosHomes = lib.mapAttrs' (host: lib.nameValuePair "${nixosHomeUsername host}@${host}") nixosHomes';
in in
lib.mapAttrs mkHome allHomes; lib.foldl' lib.mergeAttrs { }
[
homeManagerHomes
nixosHomes
];
}; };
}; };
} }

21
flake/hosts.nix Normal file
View file

@ -0,0 +1,21 @@
# Define `hosts.{darwin,home,nixos}` options for consumption in other modules
{ lib, ... }:
let
mkHostsOption = description: lib.mkOption {
inherit description;
type = with lib.types; attrsOf str;
default = { };
example = { name = "x86_64-linux"; };
};
in
{
options = {
hosts = {
darwin = mkHostsOption "Darwin hosts";
homes = mkHostsOption "Home Manager hosts";
nixos = mkHostsOption "NixOS hosts";
};
};
}

View file

@ -1,4 +1,4 @@
{ self, inputs, lib, ... }: { self, config, inputs, lib, ... }:
let let
defaultModules = [ defaultModules = [
{ {
@ -7,11 +7,13 @@ let
} }
{ {
nixpkgs.overlays = (lib.attrValues self.overlays) ++ [ nixpkgs.overlays = (lib.attrValues self.overlays) ++ [
inputs.nur.overlays.default inputs.nur.overlay
]; ];
} }
# Include generic settings # Include generic settings
"${self}/modules/nixos" "${self}/modules/nixos"
# Import common modules
"${self}/modules/common"
]; ];
buildHost = name: system: lib.nixosSystem { buildHost = name: system: lib.nixosSystem {
@ -24,12 +26,18 @@ let
inherit (self) lib; inherit (self) lib;
# Inject inputs to use them in global registry # Inject inputs to use them in global registry
inherit inputs; inherit inputs;
# For consumption by common modules
type = "nixos";
}; };
}; };
in in
{ {
flake.nixosConfigurations = lib.mapAttrs buildHost { config = {
aramis = "x86_64-linux"; hosts.nixos = {
porthos = "x86_64-linux"; aramis = "x86_64-linux";
porthos = "x86_64-linux";
};
flake.nixosConfigurations = lib.mapAttrs buildHost config.hosts.nixos;
}; };
} }

View file

@ -1,5 +1,5 @@
# Google Laptop configuration # Google Cloudtop configuration
{ lib, options, pkgs, ... }: { lib, pkgs, ... }:
{ {
services.gpg-agent.enable = lib.mkForce false; services.gpg-agent.enable = lib.mkForce false;
@ -12,10 +12,8 @@
# I use scripts that use the passthrough sequence often on this host # I use scripts that use the passthrough sequence often on this host
enablePassthrough = true; enablePassthrough = true;
terminalFeatures = { # HTerm uses `xterm-256color` as its `$TERM`, so use that here
# HTerm uses `xterm-256color` as its `$TERM`, so use that here trueColorTerminals = [ "xterm-256color" ];
xterm-256color = { };
};
}; };
ssh = { ssh = {
@ -23,21 +21,5 @@
package = pkgs.emptyDirectory; package = pkgs.emptyDirectory;
}; };
}; };
zsh = {
notify = {
enable = true;
exclude = options.my.home.zsh.notify.exclude.default ++ [
"adb shell$" # Only interactive shell sessions
];
ssh = {
enable = true;
# `notify-send` is proxied to the ChromeOS layer
useOsc777 = false;
};
};
};
}; };
} }

View file

@ -15,10 +15,8 @@
# I use scripts that use the passthrough sequence often on this host # I use scripts that use the passthrough sequence often on this host
enablePassthrough = true; enablePassthrough = true;
terminalFeatures = { # HTerm uses `xterm-256color` as its `$TERM`, so use that here
# HTerm uses `xterm-256color` as its `$TERM`, so use that here trueColorTerminals = [ "xterm-256color" ];
xterm-256color = { };
};
}; };
}; };
} }

View file

@ -26,12 +26,6 @@
firmware = { firmware = {
cpuFlavor = "intel"; cpuFlavor = "intel";
}; };
graphics = {
enable = true;
gpuFlavor = "intel";
};
}; };
hardware = { hardware = {

View file

@ -2,7 +2,7 @@
{ {
my.home = { my.home = {
# Use graphical pinentry # Use graphical pinentry
bitwarden.pinentry = pkgs.pinentry-gtk2; bitwarden.pinentry = "qt";
# Ebook library # Ebook library
calibre.enable = true; calibre.enable = true;
# Some amount of social life # Some amount of social life
@ -14,7 +14,7 @@
# Blue light filter # Blue light filter
gammastep.enable = true; gammastep.enable = true;
# Use a small popup to enter passwords # Use a small popup to enter passwords
gpg.pinentry = pkgs.pinentry-gtk2; gpg.pinentry = "qt";
# Machine specific packages # Machine specific packages
packages.additionalPackages = with pkgs; [ packages.additionalPackages = with pkgs; [
element-desktop # Matrix client element-desktop # Matrix client

View file

@ -3,14 +3,15 @@
{ {
boot = { boot = {
# Use the systemd-boot EFI boot loader. # Use the GRUB 2 boot loader.
loader = { loader.grub = {
systemd-boot.enable = true; enable = true;
efi.canTouchEfiVariables = true; # Define on which hard drive you want to install Grub.
device = "/dev/disk/by-id/ata-HGST_HUS724020ALA640_PN2181P6J58M1P";
}; };
initrd = { initrd = {
availableKernelModules = [ "ahci" "xhci_pci" "ehci_pci" "usbhid" "sd_mod" ]; availableKernelModules = [ "uhci_hcd" "ahci" "usbhid" ];
kernelModules = [ "dm-snapshot" ]; kernelModules = [ "dm-snapshot" ];
}; };

View file

@ -7,6 +7,7 @@
./hardware.nix ./hardware.nix
./home.nix ./home.nix
./networking.nix ./networking.nix
./profiles.nix
./secrets ./secrets
./services.nix ./services.nix
./system.nix ./system.nix
@ -16,5 +17,11 @@
# Set your time zone. # Set your time zone.
time.timeZone = "Europe/Paris"; time.timeZone = "Europe/Paris";
system.stateVersion = "24.05"; # Did you read the comment? # This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "20.09"; # Did you read the comment?
} }

View file

@ -1,5 +1,5 @@
# Hardware configuration # Hardware configuration
{ modulesPath, ... }: { lib, modulesPath, ... }:
{ {
imports = [ imports = [
@ -11,18 +11,9 @@
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
swapDevices = [ swapDevices = [
{ device = "/dev/disk/by-label/swap"; } { device = "/dev/disk/by-label/swap"; }
]; ];
my.hardware = { powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
firmware = {
cpuFlavor = "intel";
};
};
} }

View file

@ -1,18 +1,11 @@
{ ... }: { ... }:
{ {
my.home = { my.home = {
nix = { # Allow using 24bit color when SSH-ing from various clients
cache = { tmux.trueColorTerminals = [
# This server is the one serving the cache, don't try to query it
selfHosted = false;
};
};
# Allow using extended features when SSH-ing from various clients
tmux.terminalFeatures = {
# My usual terminal, e.g: on laptop # My usual terminal, e.g: on laptop
alacritty = { }; "alacritty"
}; ];
# Always start a tmux session when opening a shell session # Always start a tmux session when opening a shell session
zsh.launchTmux = true; zsh.launchTmux = true;

View file

@ -3,7 +3,7 @@
SWAP_SIZE=16GiB SWAP_SIZE=16GiB
parted /dev/sda --script -- \ parted /dev/sda --script -- \
mklabel gpt \ mklabel msdos \
mkpart primary 512MiB -$SWAP_SIZE \ mkpart primary 512MiB -$SWAP_SIZE \
mkpart primary linux-swap -$SWAP_SIZE 100% \ mkpart primary linux-swap -$SWAP_SIZE 100% \
mkpart ESP fat32 1MiB 512MiB \ mkpart ESP fat32 1MiB 512MiB \
@ -11,24 +11,14 @@ parted /dev/sda --script -- \
parted /dev/sdb --script -- \ parted /dev/sdb --script -- \
mklabel gpt \ mklabel gpt \
mkpart primary 0% 100% mkpart primary 0MiB 100%
parted /dev/sdc --script -- \
mklabel gpt \
mkpart primary 0% 100%
parted /dev/sdd --script -- \
mklabel gpt \
mkpart primary 0% 100%
mkfs.ext4 -L media1 /dev/sda1 mkfs.ext4 -L media1 /dev/sda1
mkfs.ext4 -L media2 /dev/sdb1 mkfs.ext4 -L media2 /dev/sdb1
mkfs.ext4 -L media3 /dev/sdc1
mkfs.ext4 -L media4 /dev/sdd1
pvcreate /dev/sda1 pvcreate /dev/sda1
pvcreate /dev/sdb1 pvcreate /dev/sdb1
pvcreate /dev/sdc1 vgcreate lvm /dev/sda1 /dev/sdb1
pvcreate /dev/sdd1
vgcreate lvm /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
lvcreate -l 100%FREE -n media lvm lvcreate -l 100%FREE -n media lvm
mkfs.ext4 -L nixos /dev/mapper/lvm-media mkfs.ext4 -L nixos /dev/mapper/lvm-media
@ -37,17 +27,17 @@ mkfs.fat -F 32 -n boot /dev/sda3
mount /dev/disk/by-label/nixos /mnt mount /dev/disk/by-label/nixos /mnt
swapon /dev/sda2 swapon /dev/sda2
mkdir -p /mnt/boot
mount /dev/disk/by-label/boot /mnt/boot
apt install sudo apt install sudo
useradd -m -G sudo setupuser useradd -m -G sudo setupuser
# shellcheck disable=2117
su setupuser
cat << EOF cat << EOF
# Run the following commands as setup user # Run the following commands as setup user
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install curl -L https://nixos.org/nix/install | sh
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh . $HOME/.nix-profile/etc/profile.d/nix.sh
nix profile install nixpkgs#nixos-install-tools nix-channel --add https://nixos.org/channels/nixos-20.09 nixpkgs
sudo "$(which nixos-generate-config)" --root /mnt sudo "$(which nixos-generate-config)" --root /mnt
# Change uuids to labels # Change uuids to labels
@ -64,6 +54,3 @@ git crypt unlock
nixos-install --root /mnt --flake '.#<hostname>' nixos-install --root /mnt --flake '.#<hostname>'
EOF EOF
# shellcheck disable=2117
su setupuser

View file

@ -6,17 +6,30 @@
hostName = "porthos"; # Define your hostname. hostName = "porthos"; # Define your hostname.
domain = "belanyi.fr"; # Define your domain. domain = "belanyi.fr"; # Define your domain.
# 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 # The global useDHCP flag is deprecated, therefore explicitly set to false here.
# still possible to use this option, but it's recommended to use it in conjunction # Per-interface useDHCP will be mandatory in the future, so this generated config
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. # replicates the default behaviour.
useDHCP = true; useDHCP = false;
interfaces = { interfaces = {
eno1.useDHCP = true; bond0.useDHCP = true;
eno2.useDHCP = true; bonding_masters.useDHCP = true;
dummy0.useDHCP = true;
erspan0.useDHCP = true;
eth0.useDHCP = true;
eth1.useDHCP = true;
gre0.useDHCP = true;
gretap0.useDHCP = true;
ifb0.useDHCP = true;
ifb1.useDHCP = true;
ip6tnl0.useDHCP = true;
sit0.useDHCP = true;
teql0.useDHCP = true;
tunl0.useDHCP = true;
}; };
}; };
# Which interface is used to connect to the internet # Which interface is used to connect to the internet
my.hardware.networking.externalInterface = "eno1"; my.hardware.networking.externalInterface = "eth0";
} }

View file

@ -0,0 +1,4 @@
{ ... }:
{
# Nothing
}

View file

@ -1,9 +1,10 @@
age-encryption.org/v1 age-encryption.org/v1
-> ssh-ed25519 cKojmg Ec0xt1uJTva8MxUdoTVX5m3uWaIiRlodf345FEM7Uzs -> ssh-ed25519 cKojmg 0bz3W8QcGaulxy+kDmM717jTthQpFOCwV9HkenFJEyo
aJIneWFJPB5HVeoUGp57agXih9YeZ6xMEbyQ+zJtWQY NKeh1/JkX4WAWbOjUeKLMbsyCevnDf3a70FfYUav26c
-> ssh-ed25519 jPowng B5XotRgv7s/FUegGhceBj7EoukewNUOIFl4TFRQf1EQ -> ssh-ed25519 jPowng Q59ybJMMteOSB6hZ5m6UPP0N2p8jrDSu5vBYwPgGcRw
PgGCBd/Pqwp7ayqi7okHBGF1SfFpwT4KlHJ/np6p2uQ j420on2jSsfMsv4MDtiOTMIFjaXV7sIsrS+g4iab+68
--- AeLgwGz6k3OABb53cXNaCU/sgI4FlU1s6p8PhAaFOlg -> z}.q-grease s2W<qM_Z t
1ÌÉCÔ¹ð¤ŽULfI1¸Hm»Ûòb}m” ÁÅ¡ìg•ß0¦¢–¤`X<16>G>\>¹8rŽz+ŠY ™¼`—Ê¢.JBUÏ!z¸Z50ú*õ¡ÙŸ¤×ÖÇ®I<C2AE>ôÔ]¹Ïå I n1Yfs/gmNsl/n9HtuKBIIT8iwIjYca2yxlh7Q1XAT1B+RZ8oGjW8yCPj1unbDGZL
ĵ<18>¿oÒÛ°…g„®„ÒêÁ³Â¿Ÿt©nƒºãcz[»{ e5BfLO3zgkEZnQ
jçå&ÁõõNæ°Nÿo{õš½‚ -eP¾=L‰™ 6¦.SP:»e¶ --- FSgNKEdDeeTjCx9jN9UtOFl58mC/Lbu1PAYRGK0CZW4
U€¿+æ©jïÝ{gø`GŽ›ÆàˆQk]šóïdÐ6å˜úy5T²$Äñs~Ùh‰Ä£òÔ<C3B2>Fº¢ç%°vöÌm<C38C>

View file

@ -1,7 +0,0 @@
age-encryption.org/v1
-> ssh-ed25519 cKojmg fpiyZo1AR5hCfk/KtbgWCTzz+05/VOUnnaHhWgXQRwc
d2w9IX/kq/T6OwQ1zImsCmzIX2yfFD8hQDbs0IW3ZIA
-> ssh-ed25519 jPowng E9R7p9NCubUQrymjnrNfEjSNIIAXrBQLogNkWsOx8xc
MrWEE5LNtOqAjnwA6byfSa1udnbUtqBy4FhdxipuA+g
--- fKgerjgGs+brvNKnrWdpmOadl34LipMT6Msqse2g3E0
Œ¡E9³ï¬KYRL-‡„°¡Ç·\EŸK{ÃÜ7âço»ïò²XÂGx<0E>ÍT’Î)Ëœôä<C3B4>6°%ˆ­LO€Tðÿ*‰™*8\£É@G

View file

@ -1,7 +1,8 @@
age-encryption.org/v1 age-encryption.org/v1
-> ssh-ed25519 cKojmg O3DMSSPQP9/ehXmzs0xcCGllu7VSzhd6b4Pii8t2vWQ -> ssh-ed25519 cKojmg dgS4bezgtDi44R1A8am+J6zh80kUVYTo1heaxJCtzX4
Ys1nMv2384elWWGW9C8HabvwUeWu52VsQpxx9L/4/dM F3w/62xwtqYa40NU7OvF9pnZzYz/5hACAGJfMA4e2zw
-> ssh-ed25519 jPowng ft/9SX5fpG7+7gHMubaFtb+50/gfNgmaofOVq5UjRUE -> ssh-ed25519 jPowng lx81CK3yeNp9RjHCUFJeKYZlRzxBmXuADVBvRc13zCI
xMwdFjFdkH0Li+PikaFt0WAZbFUu5daHgkfN8aQQumo P7e75t8xU+ZkYmeQ8mmMfyZZsRdG1J8yrvSUkiWzkFQ
--- 7DVINvXIXdE1MRwIkeajonYsy1cp4HugCxfTeub5SXU -> *z4/`-grease S/)a{e sFd";=
<¥ö¡Ãñ<ýØ{VÇ?ñfk/¤áI®"<22>ï×/5K"Š¸(ì¢ùiÃÔôìñ --- 15FVhqRTkoPFEeETRRyFQhsv4Fn19Ozlax0u8Zy9mNA
õ#+¥àÎvøSÈ4èá}<7D>§Rì%ίF4fnDœ˜J¹¤Z¸A¥Û™,_

View file

@ -1,7 +1,9 @@
age-encryption.org/v1 age-encryption.org/v1
-> ssh-ed25519 cKojmg 0J8FMcVRf78LYG+dTOFzu3luXwhOjdOg0sx4Jxdccj4 -> ssh-ed25519 cKojmg 1+cLlzctgcM0FnVDwMPOAqBkvMcDBRg8SvCw4djI93Y
tdrCcfcYbTZYhL18RG3goiqtyhu3NTn+fJhdIAnU5uA oV2XI4f1AvM9P591kZZ6NgJXa+SDtqGzCSgc4psOmxM
-> ssh-ed25519 jPowng qlF8nkSEg5fZgai0VP5eTSlZOHyj5IcalTf+QNWITVo -> ssh-ed25519 jPowng Ufjfh1p350XxRPg95+/DHdmnl4lC0bbzUUlaxd1Bmxc
O5aiZX0AJD76ixsu6i9xnnFBQANdsu3h6XzdTQ6KtKU /RHwFDSn2ov+60r1uHUigrsn99+GmmKmlk4h4T2gbA0
--- ByMQt9bnbzd8YO0Y93FIYF/lmdbYcOydkYdKxpRQujM -> *Lc$@-grease
+堍6JNm裶遁[ Eb1p)vD究侖PL9捦€z逡<7A>煸!縺贿噮'嘥閍顖卷赿5: [控d肯峈撟M抪庱zj<7A> pzVJAHy1qRq3jUrnFV0DDO7/hwV1US4Ogf0RsrVfX0xzbr73uJ003YjieVB25LqN
--- ME7/iVevyiguyhXugbkVFGzJV0yDccyKNlWbEZa/FmY
YžŠXjb2uþnd;i0íýX]…§é0þL„PÔT~óú ƒÙ^kc”$D×ÚÛr¹úu³¶fr€e¸¸þ<C2B8>+p•¨<E280A2><C2A8>&ãw®öϨ

View file

@ -1,10 +0,0 @@
age-encryption.org/v1
-> ssh-ed25519 cKojmg Lhgx43wR8PtAMf5v1eJxKlUBSAoOLdOOn/QaQrwF8zA
jfUCpgNzkHCNTWCqtErDaLMmg1Oy+s9zUra1JLCi+J4
-> ssh-ed25519 jPowng kSeQ/SmMrzd8ByVu3YHWeZyKmqFZvQSBnDunkB8e6wc
WRmnfrV5xcRXA9t0ZXx6YvbRl0sX4PTrw63VVKX4Ei4
--- a+LLM1gP9g1AbUapbeeKaS4cEcRBmPo3MHU2DSWTAds
Ò,FÜÒ6”â⬘ ixÌ<78>°Øe| «
²
ÌÏœ,{† ˆõvª!†‰zÜ$P;ãé©TØÆÉKW
qGô

View file

@ -1,7 +1,9 @@
age-encryption.org/v1 age-encryption.org/v1
-> ssh-ed25519 cKojmg 46BI3ItrXRWMivmd/K8bmkKlrYFSr8cbehAkmwCskig -> ssh-ed25519 jPowng BkIjie2KrwDLaZYYIguCs7TPA/wQy+YPguikuhfye0M
gTjYquH1hDEZ2zWD5P7gN/ejTCH8JJb8bC/VLZ3koeg 7viTA/EGYB/jRKQm6fFd86DMd4j+Jxsaw/xQ1T8ZKNo
-> ssh-ed25519 jPowng 5MqfJlasDbbqlI0dX98NZzHxmYmnnpveyBxa4z48V0o -> ssh-ed25519 cKojmg t1Y8bZvPccNAX8vWQLTfCyOJIBXN515vyfFrEI2EVww
r7Yiv4+SZiDncD0Xzp5eFSP4f2yjGBOILKxEO1iT3Os bJEjpIWrKeQrA/JfY7FRdB6hpHwR/aG4Vya1ChFNBKs
--- l43+JtT28i1YDhNX3hE3Qb7swskOBc5ghDqiyh3rU2s -> jK/-grease Oz.R ?;)G ],
Ž+)´”¯ÛPô¢nåWT,.<2E>²eÚNW€Îñ YƱkçÿF4Ê#=˜)üîò™6Ö±ÛmȵîJ<4A>ª# AuHk9TcC9kl0dg8/L6UfHIk3e9fgGwSTJAJpVgInhok
--- 47z9lol5MtpX0IsO/0ggLDMcNVfl4lNNvoHUSwOU/18
)gЪeuÞ! œš- ÞTì¥YAðM+ˆãGbMe@­|A,è&ãÆE!܆p=P²=û9¹ÙP¹!ÜöQ|Ðä r

View file

@ -1,9 +1,9 @@
age-encryption.org/v1 age-encryption.org/v1
-> ssh-ed25519 cKojmg u+5VWUy7eFq4boAIOhuKXZYD4mhczaUAcjz4+coVggA -> ssh-ed25519 cKojmg lmu3MinmydRHD0A/YVRRtopermfoBC8M8cTHfVanY1s
QlBHHgz7uY3TVgex59yZA0XgsIeHi2WN2S+UleC7bMg ygrtpZZJ7aeQTblNazpoP7DdifmDxHsE3DFJsIrWX5M
-> ssh-ed25519 jPowng IyeI6WUjF8wxe92xD3xY++4ZqXtY8divB39eLWfAtm8 -> ssh-ed25519 jPowng X0cihOc+fBtmtrkEivIHQngdYIobezXEF1x+pHqNzAw
eGj8w5X2ydS1LJvNSmo56xzRVoUB0iAKKs2NHX968Yc /+sw9x1NWY0anZhDMpAywBPrR0F4XCHaF9e8j/Yo/kI
--- hsYH9lUl3wIErJmBKzlWV+gIR5v6vgPIcNDgd0hiRGc -> 32;%1s-grease
¹Ã@Úl<C39A>ôQûsÈ„ÿ×£©Dƒ}^{ºžá¾X)¸nYóJhXhg8wƒž´ ­ “ú°˜Ó¨ÇÇw‡y(œ¸ìê.0>|ÚPSlOÃ|ÈÊE‰õÂÙé°€¡<E282AC>BWó_ˆ³ÜÌ)|x4©„šºë\_F¶ JafjuSZty6a4NSO/y4y5wHWL8Mw
ZÒo0=dts j<E28093>[ùŽõ0O+ÑÕRž8±‡ÕiüËçŽÜ»ˆõŒæÆdÀ«ß8j»â©ê --- dwCl66vdpsL0MR5NWWvg3JUnQ2QZQBeW0Dj0l5tvOKY
g¹©$x Œÿò¥Æbâ÷í<C3B7>­˜äX·¢gÂ^¼íùG¼Êô¤Ž$UÏûB*ö°é²¡£ÈÔ)[t¶ÃHa•vŸ7<>ÌÑj£âD.z¸+¬[~–õ ÁÃé9Ùý<C399>àz¼øô`sé¶,_!^YÓïʯ2H¹øS¿¼©øÅ<C3B8>øý*âñó@êjZ^ˆôæÎv~غ¶@ò<> oi,`ÓÜ#uÄwW%PoubÚ­cy8<79>ó ƒÃÉ><¿F‰Ååq…ÂKÃÇk0Çk/<2F>hÀ¥Ÿ5势ÝF+ýu‡ •e<06>¾Ÿ²óôbãè>1QŠ2®ñwn˜WbÖB˜âî<C3A2>iŸ^xurâ†- /llùÒÀÀ-ã=°7;jã0»I×%Fi¼<69>í€ø™A;Y†ìUd]KÅI0(½ ”øAg£Ðóž^†uG:äpkJŸ:q<>¢šWSaLw¯¿Ô!ïM³4ã L/ùZŇ®¢D¶-XéUb»vÊbPó0ÇÅfÂ9êú<08> †âJ`ÃX°ôÐOÅ!s{ÙÄQAšc€c;ÏÃÑ4öMíچݹ lxH&ïéöé{é}ÁäÛzZ¦œ9ûÊXžÜ“g‰]Vϱ•0gt¡¿…žw·

View file

@ -0,0 +1,9 @@
age-encryption.org/v1
-> ssh-ed25519 cKojmg N182xey8TWRVUWTRP16rT0zlhYZNr/pOZVR7YRnlIkk
HVqAag55z1cKLgjR3WsUj2wvaVjxm169JcDRJGRvCVU
-> ssh-ed25519 jPowng Dc+aaUTxDsMTY+oOst0SC3ldq1e6zX8F5A5uBL5RHhc
JWZou6+VaFc5f2OLRIrmFFWg3Er6WSY+TloXU0mP1K8
-> |9_9Aqh%-grease $ X8Mn|5 aKnl' fl<D{T-
+fAc0cajqxhYWu55HCY
--- SrmtWXQXGYxNTabSrb5tBRXHnK1F22Qoiy7hKYrrF+0
ñD·û²: ,õn0i<>½Àß^ÆŠ`üÔ2Æ#y'ý9ÖñÓÒŽéÿæ<C3BF>r]Àعx“³S=ú°ˆôuJéEÛóc€lH Ê~ ŸKtévo'êv+

View file

@ -1,9 +1,10 @@
age-encryption.org/v1 age-encryption.org/v1
-> ssh-ed25519 cKojmg l5lOlGnbvQ4D2kaSj1dd8Xr+btlNbTkT0SxSz02Vr1E -> ssh-ed25519 cKojmg OdLtFHbHbc28rUn47vgsVvXxFNg9nF+9y9R6XOK390Y
Cjy73yKL1N8LnjRXXLpxX+wIOFCa8wrG44VjXUND1lI yQQYUPQGjN2+xrSqqBYa7/zS618KrVjX5Amw2MFuSLg
-> ssh-ed25519 jPowng nYHfkP9dRkxu4Fqh8MgrbdZAc8gk+VGDyxIV6RsSeEM -> ssh-ed25519 jPowng NwUjiLtiXVi6XFmht5l1CxEs3gm0oN4vHYwDZyda7Q4
rKKi1NDoKMMzQ+kUs5ZX4zMqRBI0QwGY7q6K/L9+dLI di6znVjNRO6QdqteVNkeot5Ko2NwWLe6v+zVR3f+o10
--- Umv3UCtXlApug7uuqmwbQN38i8Lx9/b0uhLgbc3OdZM -> 4Vx%\(-grease ^^Z>EC91 R 2BJ d48Wip*s
äBLsś ?ÖsÓ“s<E2809C>2Îy yPiBgChRF31XgxccQFLO3MzRL7+5s29sfRoF3W1yUX6Bu59MpxD4D+n/jhLcxSH/
R!<fü9txB7dň<13>™ÚŠň^©ô É‡LJ&ńW €<©e] CxW7KaiOctNmPm5tWh6qjmgQ+V4bcAji5vo4FKs40l56cfyueEJj+Q
ţ/$$ --- WUGF28zqK9E1AlOeeCtSHxFg6ikRy85gOoLtBd4m0y0
.|…rr>©†ðìì1ÅÆ2SÉž.×hw<12>w qºš%i˜øé *U^­)Öè'qžµO2ÓœümòQÝ7˜¯m`

View file

@ -1,8 +1,10 @@
age-encryption.org/v1 age-encryption.org/v1
-> ssh-ed25519 cKojmg 1hbRAuAGrTy6nmkAq+UWua8weywphZsTIGF68YQEOlQ -> ssh-ed25519 cKojmg zhpo89xef68JoeOFWzhdFshrj2BXXUCFPMLVJzv6EyE
92Q7uIKv1EiO73wMh53jrTuEkzP6ziBmX9SWXCl4d3w fmJxJi5rmyai9qGwDo7iHg4BrObGre96KCpl+g91O6I
-> ssh-ed25519 jPowng aPb9v/S/mLW95Qom+swvasqY878RxpxxOkMJA2wb6nY -> ssh-ed25519 jPowng INA6EZdy4J1p3QY5mfVOQXiLdOjIDaZR+CZMP+GfkXM
qu/dzcqciqKzNc28HqFMHA1XnrJy+/wWgbfM1+BrlkE 8Nf5soaxY5SEzeJca5kaJkx7ByOvc4NkJVetB7wpEmo
--- 8PXOozvZzNZQD2OT4a+0XuIQauzUGSvovdfDugmp+bc -> xjK'w-grease
x²Žê Ã>ùý²ç¦©ðóÁÇ_ÏC9d™T5ŸûKzЄqØcZ©°É¾pŒš¾¡ ใºv f5v0cvlt4JbHlAwDOob86qOInWdlN/oohTg
)Œ³õ²¥ --- NTGv4rr+MhJ/YeZhVHOjoS1V+zCHFf2itJYfK36R+wE
š×—®JÚ dő oŞę'YFUź@
r7”ă“_N$‰˙Ź–č‡>‚ˇę]hq»-¨FŰ°qX˙?Î| Ę

View file

@ -1,7 +1,10 @@
age-encryption.org/v1 age-encryption.org/v1
-> ssh-ed25519 cKojmg r3ZUTfSNcHc1TS2fVtk99Y2xJMMunkwkcR0dQIdiCi4 -> ssh-ed25519 cKojmg tZwn2usN6K62oS4vBa6boh9zEp/+cS4chP8boXG6SH4
LICSnzAaooGy6x4wt0vNM6YtQ4S17QohZNt7lfVrD6Q Fr3kV8gUDoiDqMxPYWsHyww8umYhQEKhqbVBiVw5NeI
-> ssh-ed25519 jPowng KLU68ws4lemr0wWHxm8H8pf1SQAoUZTN4QSPzk2PyHk -> ssh-ed25519 jPowng wRbJl4G85obH/GluQBBsXE7MOvooEui65eqHfurvuQs
6pjH1pI956oaf9ZIHPPq8p3g/mZC5GxWhWkT54Wohf0 KqVZMBSyHhkayEdwI6ocmA4qhHY9zYJvg1CEKM1SOa0
--- cAQbniTwwtTftfXU/dGtA69yF/hh8iB97vHxvkIZMMo -> 2E"/OFW-grease o Qp3HFe^
°c#Ž=^Ì~?5ú-w—NT†Ì¡<C38C>¨+¶¨Ä!z¥<7A> " Zö"2ºëðù×M!pž5×V¬ÈÛjçΡѡŽâ¥âL¹ÁÌyóÐŹúš› n÷ÄŠ8zQö°+¨ËÁØ©9WSµ§<C2B5>Æ0¨u}YÚ bGhCNicPqt7txqxUiEWXCFs1OuQLqOqHmjHSqYQv919dqYep/xBXzi/aRf3dsdvh
TCJCTvZG31Qxvikp
--- xKJGbdVp+Z5h0vCBleSF2zYYYd2S5i0y4szNqjRwrDY
Tª /N¯<4E>¨¹i7m4#³MhiñP¹šÒÞ›Á¥-ÏgI÷ñ±%@E†(iÿ7·ý©ýYg¦k±´"+㸠Àª(þ]o¨¸ý†ð<E280A0>@báÊÞ§+Ï[Y"ÿÌBóóCR[ >-Ë.4d…¤b9v

View file

@ -1,8 +0,0 @@
age-encryption.org/v1
-> ssh-ed25519 cKojmg VYlHgHSLpfKb5bn1XA3aCpfX7M23DgbraLxxOfo9PDk
Rj+mDvAsWX3WwpuhTrOubmo17j/aud5+P87df5bosBA
-> ssh-ed25519 jPowng o9ZFaYrITZ6DjWw07Vk/+TkuU187/ytlEK4sw7G32G4
zmxlpDvDDEgQFqBVARXeX1ABhvfJ4uAHfa6mIxXzjAY
--- k/d9FWW8/OSo8EllwOBV74pZyX918u54jEljGk3ATUc
ü4+ø2{hE7!Ò­GA`×<>_@Íß—´¡R_ý§6J„ñL4v,6%ô‡øó#^® Ù¹ åB­§OøF|7ܽÉL]œÙj
BþóÛ¾éaòs]xS<78>Î pbÞo#¬J1QŸ=t}5Õ>Oï{+¼. M"7e»yý÷—

View file

@ -1,7 +1,9 @@
age-encryption.org/v1 age-encryption.org/v1
-> ssh-ed25519 cKojmg bICZUDqk/C2divEZu2lxUDsrtS1inSbDbS8hxJSJfHc -> ssh-ed25519 cKojmg 8rcBI7fYHuA3jO6EzJNFaAj2niIApKDt1HQEv61AKTs
FsfueyP6WCesAu5EcXIxxtvbb8RX09qNTN9GvuhYuTw ANxkIX/CeI7t7Zqp6wmjt/D194Z+xpeiidb+qvYzoQU
-> ssh-ed25519 jPowng Uujsu6c+QTXqCNi6c+zxk5tf0UQcG+Qm/SZF4dzSKCY -> ssh-ed25519 jPowng oruewwTM9X/HjjcmOPcQVdp02rQBlgJPdzvlAffs3T0
RPVNNNauz73A8kWA0VSQiMWCerUkxPoXG2MUrFly3Bc MrO0kaNhjgOkNHuz3NrIMWXNrXOHH9dT/Fk6hoQNKyY
--- 8h4hGasOwZxk+i5aQfg6AzdA1G4wROhxz2rmM9u41b8 -> COK%H7-grease
{R<>ラ=42<34> y<>咨ッ眺テj嚀廁<E59A80>WQ▽隯%畊ス宅 顕褜返<E8A49C>弁K<E5BC81>蘊マFョモ?埴膕K歯「 6yfI90QurOKlM+kgpW8KZ/iBzDYD9yhNmjG1LQ
--- uArz8eHg8sLO0sdlkM6cELFh+FHiI5BrM0+iXJxxiDo
¿vývû´ÊNÊbæ@Ÿ¡Â<C2A1>FÛMMíYËÆíÌ&‰’/%¤¹Ñm¨®ØtÁÖ“ªd†h„­|¡ðŒß©8¼Ž Ú½¨9®<11>Cã¯/Å

View file

@ -1,7 +0,0 @@
age-encryption.org/v1
-> ssh-ed25519 cKojmg nJbOfp0/wmFOZLzcWjoGB7wEB8e56aO1NntSmn5KomU
/Vio4Z/t7IPJrdzdwUPidVH3wrouSkwRzNHP0T4z3x0
-> ssh-ed25519 jPowng QXg/xqs7/VfkYQg3X77w4i53q64bL9oYeTxqb9NVhiQ
sMHIXlmrIxtIr+s0X4lBqev/PPd3AKD5P7AP5K4NeJg
--- gzTn+6+aa4Ptic1lsvSt+r3IEBysHrvMMIyONogMDF0
<EFBFBD>ÏÂ<EFBFBD>Ë®UE_í</¯çQ·Ü+U“AГMÄÿ/kï×dAL/”úÕįÍoæ\XïEDÇÑfã\ièĽàpF„`#¬nx1î<31>ûÞèDëàÂË5CéЦ&fòB»q${Gg…Aqˆ³@üVu!Cc…R\ªÖ¨

View file

@ -12,8 +12,6 @@ in
{ {
"acme/dns-key.age".publicKeys = all; "acme/dns-key.age".publicKeys = all;
"aria/rpc-token.age".publicKeys = all;
"backup/password.age".publicKeys = all; "backup/password.age".publicKeys = all;
"backup/credentials.age".publicKeys = all; "backup/credentials.age".publicKeys = all;
@ -21,24 +19,13 @@ in
"drone/secret.age".publicKeys = all; "drone/secret.age".publicKeys = all;
"drone/ssh/private-key.age".publicKeys = all; "drone/ssh/private-key.age".publicKeys = all;
"forgejo/mail-password.age" = {
owner = "git";
publicKeys = all;
};
"gitea/mail-password.age" = { "gitea/mail-password.age" = {
owner = "git"; owner = "git";
publicKeys = all; publicKeys = all;
}; };
"lohr/secret.age" = { "lohr/secret.age".publicKeys = all;
owner = "lohr"; "lohr/ssh-key.age".publicKeys = all;
publicKeys = all;
};
"lohr/ssh-key.age" = {
owner = "lohr";
publicKeys = all;
};
"matrix/mail.age" = { "matrix/mail.age" = {
owner = "matrix-synapse"; owner = "matrix-synapse";
@ -48,8 +35,7 @@ in
owner = "matrix-synapse"; owner = "matrix-synapse";
publicKeys = all; publicKeys = all;
}; };
"matrix/sliding-sync-secret.age" = {
"mealie/mail.age" = {
publicKeys = all; publicKeys = all;
}; };
@ -74,24 +60,11 @@ in
"paperless/password.age".publicKeys = all; "paperless/password.age".publicKeys = all;
"paperless/secret-key.age".publicKeys = all; "paperless/secret-key.age".publicKeys = all;
"pdf-edit/login.age".publicKeys = all;
"podgrab/password.age".publicKeys = all; "podgrab/password.age".publicKeys = all;
"pyload/credentials.age".publicKeys = all; "sso/auth-key.age".publicKeys = all;
"sso/ambroisie/password-hash.age".publicKeys = all;
"sso/auth-key.age" = { "sso/ambroisie/totp-secret.age".publicKeys = all;
owner = "nginx-sso";
publicKeys = all;
};
"sso/ambroisie/password-hash.age" = {
owner = "nginx-sso";
publicKeys = all;
};
"sso/ambroisie/totp-secret.age" = {
owner = "nginx-sso";
publicKeys = all;
};
"tandoor-recipes/secret-key.age".publicKeys = all; "tandoor-recipes/secret-key.age".publicKeys = all;

View file

@ -1,8 +1,10 @@
age-encryption.org/v1 age-encryption.org/v1
-> ssh-ed25519 cKojmg Froxrdh4H2Bsj4X2xicyBXHPRlbkRJAOztoTfzxItSM -> ssh-ed25519 cKojmg mP2H3PWJN6Pv3q6C2wci3KnXjtFAIiuGy0YH0sGIy2g
FnsLS2QYm8mJUO+c152FieLCFkALxxwQLnY4PAj8zsU f43QqyUQfTYznszub47kgc2Mz95zVScTDkwnG3INi9U
-> ssh-ed25519 jPowng pKl4p02M+U5JsiOnM2wXL5bkPwsI3IHjlTutlvez3zM -> ssh-ed25519 jPowng fENbu7+FZ1mnQQHQCLm1spLHmsQGlRoJResUJtGzYkY
NSuOFsyV8JqtTq97lNzacJnJ3YZgWp53XxU3mjUlcMQ hX+AqCkLCca6m/aKtGCThi7/mCCz/TZQNJNOlOmlqyA
--- 2TK2ViFblmDheaYdat/GF0ze1wVsla1EPLaeRdMM4Gs -> J<-grease
®àµÕ¨ENÜžämÂÛ2uÂ~Ju¼b´´t[Ý$Tñþ^2°<E28093>½jœÙÜi@xªÒ¸*Ä°g[MÞH½½Xš!”‰6Áez¼…¥DW]ÓÕ<‰` XÛâêÁÜÄPóéý÷ÃÞ n7+CPRr4oazWnE7yzpJN2ZAI4QrGsAerloP4wNeebjQDx8+IxJq1JE0g3Yi0RxzN
¶¥q*Îo¼½ÃÑ$‚åÓ<² chDccuSPLYk45Ov+SD/qqqFZlQ
--- p81HYw3LFj+qz2kiZsDcevM4ZBfvN743P9Jdi7J9XkM
¢ìÛ±S·7 <EFBFBD>ý£÷ÜãV»»Bðßâø±³ˆ¶ïO‰lEt˜Á…šqý</Ç—Ø©9²ã(ØP†$Wƒ0h;÷‰±àJy¯feø >·_D,PºVFp\æ"AM}èg?<3F>ÿ<EFBFBD>Ý/\²Ä;ùy ¬Óš(<28>ÑSñKË

View file

@ -1,8 +1,10 @@
age-encryption.org/v1 age-encryption.org/v1
-> ssh-ed25519 cKojmg KslHl4v8yCsKZn5TduLgpTfpTi1uOInC9N2e8Ow83FI -> ssh-ed25519 cKojmg +WwRpd2MzycutQFXyLsr2+GzSgF67Z6UuvyqYZaLd3w
NzcJJr8kw1ykAdWRZOeWdNhx0BTgE7FwTKcge+yLJ/w sppt8HzaZP3yxnvnhzjl18Trnz8g3VyXJ6CaVBWd7jA
-> ssh-ed25519 jPowng YGWcOai0A9l2HDZyV0GtD8kEbY/xTUssODFBcseWAkA -> ssh-ed25519 jPowng wanoqGB7T8bim/WZ4IAYViFQoGzaIZSgeoTr3YKpeTY
nJaHXkipFSHdyektoKV5y1jQrjkvnU7pwZwAymiQm7M ihDAdGa1XVW/qQz40V1v7a7iK7tu0EHMa7ayIogpcRw
--- IgWkDulol1jRa+pcx7DbEy5pvC+2nrRJHsdQVPvPur0 -> l-grease |PIcZ NIr >0;*
Bb<ÅŒb!ÏëE?:ÇÓô=÷srJC<4A>œüKz5ø®Ô{Æ4`¾&N0€ÕÈö¹57ñüví©+´1 4o8o0bevQZ6uDSx1WxxlDCURbFCM+yK1XPdrb9aztCSvG2a+ne78E42l5rBcoH7I
+(d§á¡{ ìQŠÙ m51A8uWS4nSj36N/76v6K4kelxKzWUg
--- O6cGbTAVbDcdmPHf7UzfZiyiRtu1yfL4sBI+CkJA1qw
ýqýŐ$ň`żw'čS“X¸]Ąá÷ř®úî…?¤6Đ/ĆN(Bžň N«a” HŽ7żí•I<E280A2>ú÷Ŕoz‡/4:sK",7J

View file

@ -1,7 +1,10 @@
age-encryption.org/v1 age-encryption.org/v1
-> ssh-ed25519 cKojmg tAW2hbBSxsael6cdbN+vI4h1/PMNrWYct8cppCAasn0 -> ssh-ed25519 jPowng yz0I+AazPmamF7NOnwYNrPE/ArarU01jd2mVDJUPSTY
cex/wBTviSIXc8clNm5PGltTYa1Q5PwqlX4BGsNHiyU 6Y/YQ7gb8cAZf3zT9SKOorvfUnU7kYff+gHh8fG2mY8
-> ssh-ed25519 jPowng YxfhtpytvuhIARQAaJ0w94aOZiGNUOBR0pF+Sp80D2k -> ssh-ed25519 cKojmg 0FZU9v8eHsVeE+EoX9Y4IgfIj/8+45waPaSnSDb961I
nMon/VdYUQTs6LFccDGeIKWeNYib1wwtFmEYZkDZxg0 L6SzJoh5xqai45scoVAa6v9zslBGFYNnZY044d470uQ
--- giL477X0+uZ2Ocvbixt5f5kNc1laj5P79oW8P9XsNP0 -> I[G-grease p
¨Ãd>ò±cE?nb¹vš_²'2ûûà³<1B>Õµ¥_6Pu:ÊusºE“8õ“ØÏ“xuڶ̪…Îxù̧ïžC[†®°ˆÁ .õêŽ6‰¯  qÌÀÍîJ°Ä5GäKÌ)N<ÊyYÉ¥tX=l7T´2­¨ùRÙ AMRQY1alSzHi/PLL80kcvnM1Z9YNfoUo9u5alWXYMyzrRsg+vXjMuBvAXg3fmnzr
wdOowTYMRV+jEG8vzkcQTsv+f7JIyo4DvOOaPyGfWMl1
--- ih3IAFPcN1JP3FP1vcRGnPrfk91yrnIX0m/Szkbcf7Q
ÑmW„rµœ_\)Í°]QŠ¦xMÃs/݃ÎݪäœóÍ6óº“k±äÅY§xïMy¶ J¿¸GßÃ)i2_'ÖœHF€þ.âg_Îe5³#uätñØÕ 7j„ŽPñ²'TÞ¥8´•\IàW«UùäK­°1Úº9½è

View file

@ -10,11 +10,6 @@ in
adblock = { adblock = {
enable = true; enable = true;
}; };
# Audiobook and podcast library
audiobookshelf = {
enable = true;
port = 9599;
};
# Backblaze B2 backup # Backblaze B2 backup
backup = { backup = {
enable = true; enable = true;
@ -41,14 +36,14 @@ in
flood = { flood = {
enable = true; enable = true;
}; };
# Forgejo forge # Gitea forge
forgejo = { gitea = {
enable = true; enable = true;
mail = { mail = {
enable = true; enable = true;
host = "smtp.migadu.com"; host = "smtp.migadu.com:465";
user = lib.my.mkMailAddress "forgejo" "belanyi.fr"; user = lib.my.mkMailAddress "gitea" "belanyi.fr";
passwordFile = secrets."forgejo/mail-password".path; passwordFile = secrets."gitea/mail-password".path;
}; };
}; };
# Meta-indexers # Meta-indexers
@ -69,10 +64,9 @@ in
mailConfigFile = secrets."matrix/mail".path; mailConfigFile = secrets."matrix/mail".path;
# Only necessary when doing the initial registration # Only necessary when doing the initial registration
secretFile = secrets."matrix/secret".path; secretFile = secrets."matrix/secret".path;
}; slidingSync = {
mealie = { secretFile = secrets."matrix/sliding-sync-secret".path;
enable = true; };
credentialsFile = secrets."mealie/mail".path;
}; };
miniflux = { miniflux = {
enable = true; enable = true;
@ -95,9 +89,6 @@ in
nextcloud = { nextcloud = {
enable = true; enable = true;
passwordFile = secrets."nextcloud/password".path; passwordFile = secrets."nextcloud/password".path;
collabora = {
enable = true;
};
}; };
nix-cache = { nix-cache = {
enable = true; enable = true;
@ -127,31 +118,33 @@ in
passwordFile = secrets."paperless/password".path; passwordFile = secrets."paperless/password".path;
secretKeyFile = secrets."paperless/secret-key".path; secretKeyFile = secrets."paperless/secret-key".path;
}; };
# Sometimes, editing PDFs is useful
pdf-edit = {
enable = true;
loginFile = secrets."pdf-edit/login".path;
};
# Regular backups
postgresql-backup.enable = true;
pyload = {
enable = true;
credentialsFile = secrets."pyload/credentials".path;
};
# RSS provider for websites that do not provide any feeds
rss-bridge.enable = true;
# Usenet client
sabnzbd.enable = true;
# The whole *arr software suite # The whole *arr software suite
servarr = { pirate = {
enable = true; enable = true;
# ... But not Lidarr because I don't care for music that much # ... But not Lidarr because I don't care for music that much
lidarr = { lidarr = {
enable = false; enable = false;
}; };
}; };
# Because I still need to play sysadmin # Podcast automatic downloader
podgrab = {
enable = true;
passwordFile = secrets."podgrab/password".path;
port = 9598;
};
# Regular backups
postgresql-backup.enable = true;
# RSS provider for websites that do not provide any feeds
rss-bridge.enable = true;
# Usenet client
sabnzbd.enable = true;
# Because I stilll need to play sysadmin
ssh-server.enable = true; ssh-server.enable = true;
# Recipe manager
tandoor-recipes = {
enable = true;
secretKeyFile = secrets."tandoor-recipes/secret-key".path;
};
# Torrent client and webui # Torrent client and webui
transmission = { transmission = {
enable = true; enable = true;

View file

@ -0,0 +1,35 @@
# Modules that are common to various module systems
# Usually with very small differences, if any, between them.
{ lib, type ? null, ... }:
let
allowedTypes = [
"darwin"
"home"
"nixos"
];
allowedTypesString = lib.concatStringSep ", " (builtins.map lib.escapeNixString allowedTypes);
in
{
imports = [
./profiles
];
config = {
assertions = [
{
assertion = type != null;
message = ''
You must provide `type` as part of specialArgs to use the common modules.
It must be one of ${allowedTypesString}.
'';
}
{
assertion = type != null -> builtins.elem type allowedTypes;
message = ''
`type` specialArgs must be one of ${allowedTypesString}.
'';
}
];
};
}

View file

@ -0,0 +1,19 @@
{ config, lib, type, ... }:
let
cfg = config.my.profiles.bluetooth;
in
{
options.my.profiles.bluetooth = with lib; {
enable = mkEnableOption "bluetooth profile";
};
config = lib.mkIf cfg.enable (lib.mkMerge [
(lib.optionalAttrs (type == "home") {
my.home.bluetooth.enable = true;
})
(lib.optionalAttrs (type == "nixos") {
my.hardware.bluetooth.enable = true;
})
]);
}

View file

@ -0,0 +1,25 @@
# Configuration that spans accross system and home, or are almagations of modules
{ config, lib, type, ... }:
{
imports = [
./bluetooth
./devices
./gtk
./laptop
./wm
./x
];
config = lib.mkMerge [
# Transparently enable home-manager profiles as well
(lib.optionalAttrs (type == "nixos") {
home-manager.users.${config.my.user.name} = {
config = {
my = {
inherit (config.my) profiles;
};
};
};
})
];
}

View file

@ -0,0 +1,22 @@
{ config, lib, type, ... }:
let
cfg = config.my.profiles.devices;
in
{
options.my.profiles.devices = with lib; {
enable = mkEnableOption "devices profile";
};
config = lib.mkIf cfg.enable (lib.mkMerge [
(lib.optionalAttrs (type == "nixos") {
my.hardware = {
ergodox.enable = true;
mx-ergo.enable = true;
};
# MTP devices auto-mount via file explorers
services.gvfs.enable = true;
})
]);
}

View file

@ -0,0 +1,21 @@
{ config, lib, type, ... }:
let
cfg = config.my.profiles.gtk;
in
{
options.my.profiles.gtk = with lib; {
enable = mkEnableOption "gtk profile";
};
config = lib.mkIf cfg.enable (lib.mkMerge [
(lib.optionalAttrs (type == "home") {
# GTK theme configuration
my.home.gtk.enable = true;
})
(lib.optionalAttrs (type == "nixos") {
# Allow setting GTK configuration using home-manager
programs.dconf.enable = true;
})
]);
}

View file

@ -0,0 +1,27 @@
{ config, lib, type, ... }:
let
cfg = config.my.profiles.laptop;
in
{
options.my.profiles.laptop = with lib; {
enable = mkEnableOption "laptop profile";
};
config = lib.mkIf cfg.enable (lib.mkMerge [
(lib.optionalAttrs (type == "home") {
# Enable battery notifications
my.home.power-alert.enable = true;
})
(lib.optionalAttrs (type == "nixos") {
# Enable touchpad support
services.xserver.libinput.enable = true;
# Enable TLP power management
my.services.tlp.enable = true;
# Enable upower power management
my.hardware.upower.enable = true;
})
]);
}

View file

@ -0,0 +1,36 @@
{ config, lib, type, ... }:
let
cfg = config.my.profiles.wm;
applyWm = wm: configs: lib.mkIf (cfg.windowManager == wm) (lib.my.merge configs);
in
{
options.my.profiles.wm = with lib; {
windowManager = mkOption {
type = with types; nullOr (enum [ "i3" ]);
default = null;
example = "i3";
description = "Which window manager to use";
};
};
config = lib.mkMerge [
(applyWm "i3" [
(lib.optionalAttrs (type == "home") {
# i3 settings
my.home.wm.windowManager = "i3";
# Screenshot tool
my.home.flameshot.enable = true;
# Auto disk mounter
my.home.udiskie.enable = true;
})
(lib.optionalAttrs (type == "nixos") {
# Enable i3
services.xserver.windowManager.i3.enable = true;
# udiskie fails if it can't find this dbus service
services.udisks2.enable = true;
})
])
];
}

View file

@ -0,0 +1,27 @@
{ config, lib, pkgs, type, ... }:
let
cfg = config.my.profiles.x;
in
{
options.my.profiles.x = with lib; {
enable = mkEnableOption "X profile";
};
config = lib.mkIf cfg.enable (lib.mkMerge [
(lib.optionalAttrs (type == "home") {
# X configuration
my.home.x.enable = true;
})
(lib.optionalAttrs (type == "nixos") {
# Enable the X11 windowing system.
services.xserver.enable = true;
# Nice wallpaper
services.xserver.displayManager.lightdm.background =
let
wallpapers = "${pkgs.plasma5Packages.plasma-workspace-wallpapers}/share/wallpapers";
in
"${wallpapers}/summer_1am/contents/images/2560x1600.jpg";
})
]);
}

View file

@ -1,19 +1,15 @@
{ config, lib, pkgs, ... }: { config, lib, ... }:
let let
cfg = config.my.home.atuin; cfg = config.my.home.atuin;
in in
{ {
options.my.home.atuin = with lib; { options.my.home.atuin = with lib; {
enable = my.mkDisableOption "atuin configuration"; enable = my.mkDisableOption "atuin configuration";
# I want the full experience by default
package = mkPackageOption pkgs "atuin" { };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.atuin = { programs.atuin = {
enable = true; enable = true;
inherit (cfg) package;
flags = [ flags = [
# I *despise* this hijacking of the up key, even though I use Ctrl-p # I *despise* this hijacking of the up key, even though I use Ctrl-p
@ -29,8 +25,6 @@ in
search_mode = "skim"; search_mode = "skim";
# Show long command lines at the bottom # Show long command lines at the bottom
show_preview = true; show_preview = true;
# I like being able to edit my commands
enter_accept = false;
}; };
}; };
}; };

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }: { config, lib, ... }:
let let
cfg = config.my.home.bitwarden; cfg = config.my.home.bitwarden;
in in
@ -6,7 +6,12 @@ in
options.my.home.bitwarden = with lib; { options.my.home.bitwarden = with lib; {
enable = my.mkDisableOption "bitwarden configuration"; enable = my.mkDisableOption "bitwarden configuration";
pinentry = mkPackageOption pkgs "pinentry" { default = [ "pinentry-tty" ]; }; pinentry = mkOption {
type = types.str;
default = "tty";
example = "gtk2";
description = "Which pinentry interface to use";
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -5,13 +5,11 @@ in
{ {
options.my.home.calibre = with lib; { options.my.home.calibre = with lib; {
enable = mkEnableOption "calibre configuration"; enable = mkEnableOption "calibre configuration";
package = mkPackageOption pkgs "calibre" { };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
cfg.package calibre
]; ];
}; };
} }

View file

@ -39,7 +39,6 @@
./tmux ./tmux
./udiskie ./udiskie
./vim ./vim
./wget
./wm ./wm
./x ./x
./xdg ./xdg

View file

@ -7,9 +7,9 @@ in
enable = my.mkDisableOption "direnv configuration"; enable = my.mkDisableOption "direnv configuration";
defaultFlake = mkOption { defaultFlake = mkOption {
type = with types; nullOr str; type = types.str;
default = null; default = "pkgs";
example = "pkgs"; example = "nixpkgs";
description = '' description = ''
Which flake from the registry should be used for Which flake from the registry should be used for
<command>use pkgs</command> by default. <command>use pkgs</command> by default.
@ -39,7 +39,7 @@ in
in in
lib.my.genAttrs' files linkLibFile; lib.my.genAttrs' files linkLibFile;
home.sessionVariables = lib.mkIf (cfg.defaultFlake != null) { home.sessionVariables = {
DIRENV_DEFAULT_FLAKE = cfg.defaultFlake; DIRENV_DEFAULT_FLAKE = cfg.defaultFlake;
}; };
}; };

View file

@ -1,4 +1,4 @@
# shellcheck shell=bash #shellcheck shell=bash
# shellcheck disable=2155 # shellcheck disable=2155
use_android() { use_android() {
@ -32,16 +32,10 @@ use_android() {
-b|--build-tools) -b|--build-tools)
build_tools_version="$2" build_tools_version="$2"
shift 2 shift 2
if ! [ -e "$ANDROID_HOME/build-tools/$build_tools_version" ]; then
log_error "use_android: build-tools version '$build_tools_version' does not exist"
fi
;; ;;
-n|--ndk) -n|--ndk)
ndk_version="$2" ndk_version="$2"
shift 2 shift 2
if ! [ -e "$ANDROID_HOME/ndk/$ndk_version" ]; then
log_error "use_android: NDK version '$ndk_version' does not exist"
fi
;; ;;
--) --)
shift shift

View file

@ -1,4 +1,4 @@
# shellcheck shell=bash #shellcheck shell=bash
use_pkgs() { use_pkgs() {
if ! has nix; then if ! has nix; then

View file

@ -1,4 +1,4 @@
# shellcheck shell=bash #shellcheck shell=bash
layout_postgres() { layout_postgres() {
if ! has postgres || ! has initdb; then if ! has postgres || ! has initdb; then

View file

@ -1,4 +1,4 @@
# shellcheck shell=bash #shellcheck shell=bash
layout_poetry() { layout_poetry() {
if ! has poetry; then if ! has poetry; then
@ -9,12 +9,12 @@ layout_poetry() {
if [[ ! -f pyproject.toml ]]; then if [[ ! -f pyproject.toml ]]; then
# shellcheck disable=2016 # shellcheck disable=2016
log_error 'layout_poetry: no pyproject.toml found. Use `poetry init` to create one first' log_error 'layout_poetry: no pyproject.toml found. Use `poetry new` or `poetry init` to create one first'
return 1 return 1
fi fi
# create venv if it doesn't exist # create venv if it doesn't exist
poetry run -q -- true poetry run true
# shellcheck disable=2155 # shellcheck disable=2155
export VIRTUAL_ENV=$(poetry env info --path) export VIRTUAL_ENV=$(poetry env info --path)
@ -23,35 +23,3 @@ layout_poetry() {
watch_file pyproject.toml watch_file pyproject.toml
watch_file poetry.lock watch_file poetry.lock
} }
layout_uv() {
if ! has uv; then
# shellcheck disable=2016
log_error 'layout_uv: `uv` is not in PATH'
return 1
fi
if [[ ! -f pyproject.toml ]]; then
# shellcheck disable=2016
log_error 'layout_uv: no pyproject.toml found. Use `uv init` to create one first'
return 1
fi
local default_venv="$PWD/.venv"
: "${VIRTUAL_ENV:=$default_venv}"
# Use non-default venv path if required
if [ "$VIRTUAL_ENV" != "$default_venv" ]; then
export UV_PROJECT_ENVIRONMENT="$VIRTUAL_ENV"
fi
# create venv if it doesn't exist
uv venv -q
export VIRTUAL_ENV
export UV_ACTIVE=1
PATH_add "$VIRTUAL_ENV/bin"
watch_file pyproject.toml
watch_file uv.lock
watch_file .python-version
}

View file

@ -7,13 +7,11 @@ in
{ {
options.my.home.discord = with lib; { options.my.home.discord = with lib; {
enable = mkEnableOption "discord configuration"; enable = mkEnableOption "discord configuration";
package = mkPackageOption pkgs "discord" { };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
cfg.package discord
]; ];
xdg.configFile."discord/settings.json".source = xdg.configFile."discord/settings.json".source =

View file

@ -4,7 +4,7 @@
" Use dark color scheme " Use dark color scheme
colorscheme dark colorscheme dark
" Make tridactyl open Vim in my preferred terminal " Make tridactyl open Vim in my prefered terminal
set editorcmd @editorcmd@ set editorcmd @editorcmd@
" Remove editor file after use " Remove editor file after use
@ -15,8 +15,8 @@ bind --mode=input <C-i> editor_rm
" Binds {{{ " Binds {{{
" Reddit et al. {{{ " Reddit et al. {{{
" Toggle comments on Reddit, Hacker News, Lobste.rs, LWN " Toggle comments on Reddit, Hacker News, Lobste.rs
bind ;c hint -Jc [class*="expand"],[class*="togg"],[class="comment_folder"],[class="CommentTitle"] bind ;c hint -Jc [class*="expand"],[class*="togg"],[class="comment_folder"]
" Make `gu` take me back to subreddit from comments " Make `gu` take me back to subreddit from comments
bindurl reddit.com gu urlparent 3 bindurl reddit.com gu urlparent 3
@ -26,8 +26,8 @@ bindurl www.google.com f hint -Jc #search a
bindurl www.google.com F hint -Jbc #search a bindurl www.google.com F hint -Jbc #search a
" Only hint search results on DuckDuckGo " Only hint search results on DuckDuckGo
bindurl ^https://duckduckgo.com f hint -Jc [data-testid="result"] bindurl ^https://duckduckgo.com f hint -Jc [data-testid="result-title-a"]
bindurl ^https://duckduckgo.com F hint -Jbc [data-testid="result"] bindurl ^https://duckduckgo.com F hint -Jbc [data-testid="result-title-a"]
" Only hint item pages on Hacker News " Only hint item pages on Hacker News
bindurl news.ycombinator.com ;f hint -Jc .age > a bindurl news.ycombinator.com ;f hint -Jc .age > a
@ -69,6 +69,8 @@ unbind <C-f>
" Redirections {{{ " Redirections {{{
" Always redirect Reddit to the old site " Always redirect Reddit to the old site
autocmd DocStart ^http(s?)://www.reddit.com js tri.excmds.urlmodify("-t", "www", "old") autocmd DocStart ^http(s?)://www.reddit.com js tri.excmds.urlmodify("-t", "www", "old")
" Use a better Twitter front-end
autocmd DocStart ^http(s?)://twitter.com js tri.excmds.urlmodify("-t", "twitter.com", "nitter.net")
" }}} " }}}
" Disabled websites {{{ " Disabled websites {{{

View file

@ -6,29 +6,27 @@ in
options.my.home.gdb = with lib; { options.my.home.gdb = with lib; {
enable = my.mkDisableOption "gdb configuration"; enable = my.mkDisableOption "gdb configuration";
package = mkPackageOption pkgs "gdb" { };
rr = { rr = {
enable = my.mkDisableOption "rr configuration"; enable = my.mkDisableOption "rr configuration";
package = mkPackageOption pkgs "rr" { }; package = mkOption {
type = types.package;
default = pkgs.rr;
defaultText = literalExample "pkgs.rr";
description = ''
Package providing rr
'';
};
}; };
}; };
config = lib.mkIf cfg.enable (lib.mkMerge [ config = lib.mkIf cfg.enable (lib.mkMerge [
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
cfg.package gdb
]; ];
xdg = { xdg.configFile."gdb/gdbinit".source = ./gdbinit;
configFile."gdb/gdbinit".source = ./gdbinit;
stateFile."gdb/.keep".text = "";
};
home.sessionVariables = {
GDBHISTFILE = "${config.xdg.stateHome}/gdb/gdb_history";
};
} }
(lib.mkIf cfg.rr.enable { (lib.mkIf cfg.rr.enable {

View file

@ -148,10 +148,6 @@ in
autoStash = true; autoStash = true;
}; };
rerere = {
enabled = true;
};
url = { url = {
"git@git.belanyi.fr:" = { "git@git.belanyi.fr:" = {
insteadOf = "https://git.belanyi.fr/"; insteadOf = "https://git.belanyi.fr/";

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }: { config, lib, ... }:
let let
cfg = config.my.home.gpg; cfg = config.my.home.gpg;
in in
@ -6,7 +6,12 @@ in
options.my.home.gpg = with lib; { options.my.home.gpg = with lib; {
enable = my.mkDisableOption "gpg configuration"; enable = my.mkDisableOption "gpg configuration";
pinentry = mkPackageOption pkgs "pinentry" { default = [ "pinentry-tty" ]; }; pinentry = mkOption {
type = types.str;
default = "tty";
example = "gtk2";
description = "Which pinentry interface to use";
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@ -17,7 +22,7 @@ in
services.gpg-agent = { services.gpg-agent = {
enable = true; enable = true;
enableSshSupport = true; # One agent to rule them all enableSshSupport = true; # One agent to rule them all
pinentryPackage = cfg.pinentry; pinentryFlavor = cfg.pinentry;
extraConfig = '' extraConfig = ''
allow-loopback-pinentry allow-loopback-pinentry
''; '';

View file

@ -21,12 +21,12 @@ in
}; };
iconTheme = { iconTheme = {
package = pkgs.gnome-themes-extra; package = pkgs.gnome.gnome-themes-extra;
name = "Adwaita"; name = "Adwaita";
}; };
theme = { theme = {
package = pkgs.gnome-themes-extra; package = pkgs.gnome.gnome-themes-extra;
name = "Adwaita"; name = "Adwaita";
}; };
}; };

View file

@ -18,6 +18,8 @@ let
himalaya = { himalaya = {
enable = cfg.himalaya.enable; enable = cfg.himalaya.enable;
# FIXME: try to actually configure it at some point # FIXME: try to actually configure it at some point
backend = "imap";
sender = "smtp";
}; };
msmtp = { msmtp = {
@ -58,7 +60,7 @@ in
{ {
config.accounts.email.accounts = { config.accounts.email.accounts = {
personal = lib.mkMerge [ personal = lib.mkMerge [
# Common configuration # Common configuraton
(mkConfig { (mkConfig {
domain = "belanyi.fr"; domain = "belanyi.fr";
address = "bruno"; address = "bruno";
@ -70,7 +72,7 @@ in
]; ];
gmail = lib.mkMerge [ gmail = lib.mkMerge [
# Common configuration # Common configuraton
(mkConfig { (mkConfig {
domain = "gmail.com"; domain = "gmail.com";
address = "brunobelanyi"; address = "brunobelanyi";

View file

@ -13,7 +13,6 @@ in
scripts = [ scripts = [
pkgs.mpvScripts.mpris # Allow controlling using media keys pkgs.mpvScripts.mpris # Allow controlling using media keys
pkgs.mpvScripts.mpv-cheatsheet # Show some simple mappings on '?'
pkgs.mpvScripts.uosc # Nicer UI pkgs.mpvScripts.uosc # Nicer UI
]; ];
}; };

View file

@ -12,7 +12,7 @@ let
# Use pinned nixpkgs when using `nix run pkgs#<whatever>` # Use pinned nixpkgs when using `nix run pkgs#<whatever>`
pkgs = inputs.nixpkgs; pkgs = inputs.nixpkgs;
} }
(lib.optionalAttrs cfg.inputs.overrideNixpkgs { (lib.optionalAttrs cfg.overrideNixpkgs {
# ... And with `nix run nixpkgs#<whatever>` # ... And with `nix run nixpkgs#<whatever>`
nixpkgs = inputs.nixpkgs; nixpkgs = inputs.nixpkgs;
}) })
@ -22,30 +22,20 @@ in
options.my.home.nix = with lib; { options.my.home.nix = with lib; {
enable = my.mkDisableOption "nix configuration"; enable = my.mkDisableOption "nix configuration";
gc = { linkInputs = my.mkDisableOption "link inputs to `$XDG_CONFIG_HOME/nix/inputs`";
enable = my.mkDisableOption "nix GC configuration";
};
cache = { addToRegistry = my.mkDisableOption "add inputs and self to registry";
selfHosted = my.mkDisableOption "self-hosted cache";
};
inputs = { addToNixPath = my.mkDisableOption "add inputs and self to nix path";
link = my.mkDisableOption "link inputs to `$XDG_CONFIG_HOME/nix/inputs/`";
addToRegistry = my.mkDisableOption "add inputs and self to registry"; overrideNixpkgs = my.mkDisableOption "point nixpkgs to pinned system version";
addToNixPath = my.mkDisableOption "add inputs and self to nix path";
overrideNixpkgs = my.mkDisableOption "point nixpkgs to pinned system version";
};
}; };
config = lib.mkIf cfg.enable (lib.mkMerge [ config = lib.mkIf cfg.enable (lib.mkMerge [
{ {
assertions = [ assertions = [
{ {
assertion = cfg.inputs.addToNixPath -> cfg.inputs.link; assertion = cfg.addToNixPath -> cfg.linkInputs;
message = '' message = ''
enabling `my.home.nix.addToNixPath` needs to have enabling `my.home.nix.addToNixPath` needs to have
`my.home.nix.linkInputs = true` `my.home.nix.linkInputs = true`
@ -64,37 +54,7 @@ in
}; };
} }
(lib.mkIf cfg.gc.enable { (lib.mkIf cfg.addToRegistry {
nix.gc = {
automatic = true;
# Every week, with some wiggle room
frequency = "weekly";
randomizedDelaySec = "10min";
# Use a persistent timer for e.g: laptops
persistent = true;
# Delete old profiles automatically after 15 days
options = "--delete-older-than 15d";
};
})
(lib.mkIf cfg.cache.selfHosted {
nix = {
settings = {
extra-substituters = [
"https://cache.belanyi.fr/"
];
extra-trusted-public-keys = [
"cache.belanyi.fr:LPhrTqufwfxTceg1nRWueDWf7/2zSVY9K00pq2UI7tw="
];
};
};
})
(lib.mkIf cfg.inputs.addToRegistry {
nix.registry = nix.registry =
let let
makeEntry = v: { flake = v; }; makeEntry = v: { flake = v; };
@ -103,7 +63,7 @@ in
makeEntries channels; makeEntries channels;
}) })
(lib.mkIf cfg.inputs.link { (lib.mkIf cfg.linkInputs {
xdg.configFile = xdg.configFile =
let let
makeLink = n: v: { makeLink = n: v: {
@ -115,8 +75,8 @@ in
makeLinks channels; makeLinks channels;
}) })
(lib.mkIf cfg.inputs.addToNixPath { (lib.mkIf cfg.addToNixPath {
nix.nixPath = [ "${config.xdg.configHome}/nix/inputs" ]; home.sessionVariables.NIX_PATH = "${config.xdg.configHome}/nix/inputs\${NIX_PATH:+:$NIX_PATH}";
}) })
]); ]);
} }

View file

@ -26,7 +26,6 @@ in
fd fd
file file
ripgrep ripgrep
tree
] ++ cfg.additionalPackages); ] ++ cfg.additionalPackages);
nixpkgs.config = { nixpkgs.config = {

View file

@ -15,8 +15,7 @@ in
# Clear the screen on start and exit # Clear the screen on start and exit
LESS = "-R -+X -c"; LESS = "-R -+X -c";
# Better XDG compliance # Better XDG compliance
LESSHISTFILE = "${config.xdg.stateHome}/less/history"; LESSHISTFILE = "${config.xdg.dataHome}/less/history";
LESSKEY = "${config.xdg.configHome}/less/lesskey";
}; };
}; };
} }

View file

@ -49,7 +49,7 @@ in
}; };
porthos = { porthos = {
hostname = "37.187.146.15"; hostname = "91.121.177.163";
identityFile = "~/.ssh/shared_rsa"; identityFile = "~/.ssh/shared_rsa";
user = "ambroisie"; user = "ambroisie";
}; };

View file

@ -5,14 +5,6 @@ let
config.my.home.x.enable config.my.home.x.enable
(config.my.home.wm.windowManager != null) (config.my.home.wm.windowManager != null)
]; ];
mkTerminalFlags = opt: flag:
let
mkFlag = term: ''set -as terminal-features ",${term}:${flag}"'';
enabledTerminals = lib.filterAttrs (_: v: v.${opt}) cfg.terminalFeatures;
terminals = lib.attrNames enabledTerminals;
in
lib.concatMapStringsSep "\n" mkFlag terminals;
in in
{ {
options.my.home.tmux = with lib; { options.my.home.tmux = with lib; {
@ -20,22 +12,16 @@ in
enablePassthrough = mkEnableOption "tmux DCS passthrough sequence"; enablePassthrough = mkEnableOption "tmux DCS passthrough sequence";
terminalFeatures = mkOption { trueColorTerminals = mkOption {
type = with types; attrsOf (submodule { type = with types; listOf str;
options = { default = lib.my.nullableToList config.my.home.terminal.program;
hyperlinks = my.mkDisableOption "hyperlinks through OSC8"; defaultText = ''
`[ config.my.home.terminal.program ]` if it is non-null, otherwise an
trueColor = my.mkDisableOption "24-bit (RGB) color support"; empty list.
};
});
default = { ${config.my.home.terminal.program} = { }; };
defaultText = literalExpression ''
{ ''${config.my.home.terminal.program} = { }; };
''; '';
example = { xterm-256color = { }; }; example = [ "xterm-256color" ];
description = '' description = ''
$TERM values which should be considered to have additional features. $TERM values which should be considered to always support 24-bit color.
''; '';
}; };
}; };
@ -46,9 +32,7 @@ in
keyMode = "vi"; # Home-row keys and other niceties keyMode = "vi"; # Home-row keys and other niceties
clock24 = true; # I'm one of those heathens clock24 = true; # I'm one of those heathens
escapeTime = 0; # Let vim do its thing instead escapeTime = 0; # Let vim do its thing instead
historyLimit = 100000; # Bigger buffer historyLimit = 50000; # Bigger buffer
mouse = false; # I dislike mouse support
focusEvents = true; # Report focus events
terminal = "tmux-256color"; # I want accurate termcap info terminal = "tmux-256color"; # I want accurate termcap info
plugins = with pkgs.tmuxPlugins; [ plugins = with pkgs.tmuxPlugins; [
@ -82,13 +66,6 @@ in
]; ];
extraConfig = '' extraConfig = ''
# Refresh configuration
bind-key -N "Source tmux.conf" R source-file ${config.xdg.configHome}/tmux/tmux.conf \; display-message "Sourced tmux.conf!"
# Accept sloppy Ctrl key when switching windows, on top of default mapping
bind-key -N "Select the previous window" C-p previous-window
bind-key -N "Select the next window" C-n next-window
# Better vim mode # Better vim mode
bind-key -T copy-mode-vi 'v' send -X begin-selection bind-key -T copy-mode-vi 'v' send -X begin-selection
${ ${
@ -112,10 +89,13 @@ in
'' ''
} }
# Force OSC8 hyperlinks for each relevant $TERM
${mkTerminalFlags "hyperlinks" "hyperlinks"}
# Force 24-bit color for each relevant $TERM # Force 24-bit color for each relevant $TERM
${mkTerminalFlags "trueColor" "RGB"} ${
let
mkTcFlag = term: ''set -as terminal-features ",${term}:RGB"'';
in
lib.concatMapStringsSep "\n" mkTcFlag cfg.trueColorTerminals
}
''; '';
}; };
} }

View file

@ -1,6 +0,0 @@
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Set comment string, as it seems that no official GN support exists upstream
setlocal commentstring=#\ %s
let b:undo_ftplugin.='|setlocal commentstring<'

View file

@ -1,6 +0,0 @@
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Use a small indentation value on JSON files
setlocal shiftwidth=2
let b:undo_ftplugin.='|setlocal shiftwidth<'

View file

@ -0,0 +1,6 @@
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Don't show Netrw in buffer list
setlocal bufhidden=delete
let b:undo_ftplugin='|setlocal bufhidden<'

View file

@ -0,0 +1,10 @@
local wk = require("which-key")
local keys = {
name = "Comment/uncomment",
c = "Current line",
u = "Uncomment the current and adjacent commented lines",
["gc"] = "Uncomment the current and adjacent commented lines",
}
wk.register(keys, { prefix = "gc" })

View file

@ -0,0 +1,7 @@
local wk = require("which-key")
local keys = {
["<leader>"] = { "<cmd>nohls<CR>", "Clear search highlight" },
}
wk.register(keys, { prefix = "<leader>" })

View file

@ -0,0 +1,15 @@
local wk = require("which-key")
local telescope_builtin = require("telescope.builtin")
local keys = {
f = {
name = "Fuzzy finder",
b = { telescope_builtin.buffers, "Open buffers" },
f = { telescope_builtin.git_files, "Git tracked files" },
F = { telescope_builtin.find_files, "Files" },
g = { telescope_builtin.live_grep, "Grep string" },
G = { telescope_builtin.grep_string, "Grep string under cursor" },
},
}
wk.register(keys, { prefix = "<leader>" })

View file

@ -0,0 +1,30 @@
local wk = require("which-key")
local motions = {
["]m"] = "Next method start",
["]M"] = "Next method end",
["]S"] = "Next statement start",
["]]"] = "Next class start",
["]["] = "Next class end",
["[m"] = "Previous method start",
["[M"] = "Previous method end",
["[S"] = "Previous statement start",
["[["] = "Previous class start",
["[]"] = "Previous class end",
}
local objects = {
["aa"] = "a parameter",
["ia"] = "inner parameter",
["ab"] = "a block",
["ib"] = "inner block",
["ac"] = "a class",
["ic"] = "inner class",
["af"] = "a function",
["if"] = "inner function",
["ak"] = "a comment",
["aS"] = "a statement",
}
wk.register(motions, { mode = "n" })
wk.register(objects, { mode = "o" })

View file

@ -3,124 +3,126 @@ local wk = require("which-key")
local lsp = require("ambroisie.lsp") local lsp = require("ambroisie.lsp")
local keys = { local keys = {
-- Previous -- Edition and navigation mappins
{ "[", group = "Previous" }, ["["] = {
-- Edition and navigation mappings name = "Previous",
{ "[<space>", desc = "Insert blank line above" }, ["<space>"] = "Insert blank line above",
{ "[<C-L>", desc = "Previous location list file" }, ["<C-L>"] = "Previous location list file",
{ "[<C-Q>", desc = "Previous quickfix list file" }, ["<C-Q>"] = "Previous quickfix list file",
{ "[<C-T>", desc = "Previous tag in preview window" }, ["<C-T>"] = "Previous tag in preview window",
{ "[a", desc = "Previous argument" }, a = "Previous argument",
{ "[A", desc = "First argument" }, A = "First argument",
{ "[b", desc = "Previous buffer" }, b = "Previous buffer",
{ "[B", desc = "First buffer" }, B = "First buffer",
{ "[e", desc = "Exchange previous line" }, e = "Exchange previous line",
{ "[f", desc = "Previous file in directory" }, f = "Previous file in directory",
{ "[l", desc = "Previous location list entry" }, l = "Previous location list entry",
{ "[L", desc = "First Location list entry" }, L = "First Location list entry",
{ "[n", desc = "Previous conflict marker/diff hunk" }, n = "Previous conflict marker/diff hunk",
{ "[p", desc = "Paste line above" }, p = "Paste line above",
{ "[P", desc = "Paste line above" }, P = "Paste line above",
{ "[q", desc = "Previous quickfix list entry" }, q = "Previous quickfix list entry",
{ "[Q", desc = "First quickfix list entry" }, Q = "First quickfix list entry",
{ "[t", desc = "Previous matching tag" }, t = "Previous matching tag",
{ "[T", desc = "First matching tag" }, T = "First matching tag",
{ "[z", desc = "Previous fold" }, z = "Previous fold",
-- Encoding -- Encoding
{ "[C", desc = "C string encode" }, C = "C string encode",
{ "[u", desc = "URL encode" }, u = "URL encode",
{ "[x", desc = "XML encode" }, x = "XML encode",
{ "[y", desc = "C string encode" }, y = "C string encode",
-- Custom -- Custom
{ "[d", lsp.goto_prev_diagnostic, desc = "Previous diagnostic" }, d = { lsp.goto_prev_diagnostic, "Previous diagnostic" },
},
["]"] = {
name = "Next",
["<space>"] = "Insert blank line below",
["<C-L>"] = "Next location list file",
["<C-Q>"] = "Next quickfix list file",
["<C-T>"] = "Next tag in preview window",
a = "Next argument",
A = "Last argument",
b = "Next buffer",
B = "Last buffer",
e = "Exchange next line",
f = "Next file in directory",
l = "Next location list entry",
L = "Last Location list entry",
n = "Next conflict marker/diff hunk",
p = "Paste line below",
P = "Paste line below",
q = "Next quickfix list entry",
Q = "Last quickfix list entry",
t = "Next matching tag",
T = "Last matching tag",
z = "Next fold",
-- Decoding
C = "C string decode",
u = "URL decode",
x = "XML decode",
y = "C string decode",
-- Custom
d = { lsp.goto_next_diagnostic, "Next diagnostic" },
},
-- Next -- Option mappings
{ "]", group = "Next" }, ["[o"] = {
-- Edition and navigation mappings name = "Enable option",
{ "]<space>", desc = "Insert blank line below" }, b = "Light background",
{ "]<C-L>", desc = "Next location list file" }, c = "Cursor line",
{ "]<C-Q>", desc = "Next quickfix list file" }, d = "Diff",
{ "]<C-T>", desc = "Next tag in preview window" }, f = { "<cmd>FormatEnable<CR>", "LSP Formatting" },
{ "]a", desc = "Next argument" }, h = "Search high-lighting",
{ "]A", desc = "Last argument" }, i = "Case insensitive search",
{ "]b", desc = "Next buffer" }, l = "List mode",
{ "]B", desc = "Last buffer" }, n = "Line numbers",
{ "]e", desc = "Exchange next line" }, r = "Relative line numbers",
{ "]f", desc = "Next file in directory" }, p = { "<cmd>lwindow<CR>", "Location list" },
{ "]l", desc = "Next location list entry" }, q = { "<cmd>cwindow<CR>", "Quickfix list" },
{ "]L", desc = "Last Location list entry" }, u = "Cursor column",
{ "]n", desc = "Next conflict marker/diff hunk" }, v = "Virtual editing",
{ "]p", desc = "Paste line below" }, w = "Text wrapping",
{ "]P", desc = "Paste line below" }, x = "Cursor line and column",
{ "]q", desc = "Next quickfix list entry" }, z = "Spell checking",
{ "]Q", desc = "Last quickfix list entry" }, },
{ "]t", desc = "Next matching tag" }, ["]o"] = {
{ "]T", desc = "Last matching tag" }, name = "Option off",
{ "]z", desc = "Next fold" }, b = "Light background",
-- Decoding c = "Cursor line",
{ "]C", desc = "C string decode" }, d = "Diff",
{ "]u", desc = "URL decode" }, f = { "<cmd>FormatDisable<CR>", "LSP Formatting" },
{ "]x", desc = "XML decode" }, h = "Search high-lighting",
{ "]y", desc = "C string decode" }, i = "Case insensitive search",
-- Custom l = "List mode",
{ "]d", lsp.goto_next_diagnostic, desc = "Next diagnostic" }, n = "Line numbers",
p = { "<cmd>lclose<CR>", "Location list" },
-- Enable option q = { "<cmd>cclose<CR>", "Quickfix list" },
{ "[o", group = "Enable option" }, r = "Relative line numbers",
{ "[ob", desc = "Light background" }, u = "Cursor column",
{ "[oc", desc = "Cursor line" }, v = "Virtual editing",
{ "[od", desc = "Diff" }, w = "Text wrapping",
{ "[of", "<cmd>FormatEnable<CR>", desc = "LSP Formatting" }, x = "Cursor line and column",
{ "[oh", desc = "Search high-lighting" }, z = "Spell checking",
{ "[oi", desc = "Case insensitive search" }, },
{ "[ol", desc = "List mode" }, ["yo"] = {
{ "[on", desc = "Line numbers" }, name = "Option toggle",
{ "[or", desc = "Relative line numbers" }, b = "Light background",
{ "[op", "<cmd>lwindow<CR>", desc = "Location list" }, c = "Cursor line",
{ "[oq", "<cmd>cwindow<CR>", desc = "Quickfix list" }, d = "Diff",
{ "[ou", desc = "Cursor column" }, f = { "<cmd>FormatToggle<CR>", "LSP Formatting" },
{ "[ov", desc = "Virtual editing" }, h = "Search high-lighting",
{ "[ow", desc = "Text wrapping" }, i = "Case insensitive search",
{ "[ox", desc = "Cursor line and column" }, l = "List mode",
{ "[oz", desc = "Spell checking" }, n = "Line numbers",
p = { "<Plug>(qf_loc_toggle)", "Location list" },
-- Disable option q = { "<Plug>(qf_qf_toggle)", "Quickfix list" },
{ "]o", group = "Disable option" }, r = "Relative line numbers",
{ "]ob", desc = "Light background" }, u = "Cursor column",
{ "]oc", desc = "Cursor line" }, v = "Virtual editing",
{ "]od", desc = "Diff" }, w = "Text wrapping",
{ "]of", "<cmd>FormatDisable<CR>", desc = "LSP Formatting" }, x = "Cursor line and column",
{ "]oh", desc = "Search high-lighting" }, z = "Spell checking",
{ "]oi", desc = "Case insensitive search" }, },
{ "]ol", desc = "List mode" },
{ "]on", desc = "Line numbers" },
{ "]op", "<cmd>lclose<CR>", desc = "Location list" },
{ "]oq", "<cmd>cclose<CR>", desc = "Quickfix list" },
{ "]or", desc = "Relative line numbers" },
{ "]ou", desc = "Cursor column" },
{ "]ov", desc = "Virtual editing" },
{ "]ow", desc = "Text wrapping" },
{ "]ox", desc = "Cursor line and column" },
{ "]oz", desc = "Spell checking" },
-- Toggle option
{ "yo", group = "Toggle option" },
{ "yob", desc = "Light background" },
{ "yoc", desc = "Cursor line" },
{ "yod", desc = "Diff" },
{ "yof", "<cmd>FormatToggle<CR>", desc = "LSP Formatting" },
{ "yoh", desc = "Search high-lighting" },
{ "yoi", desc = "Case insensitive search" },
{ "yol", desc = "List mode" },
{ "yon", desc = "Line numbers" },
{ "yop", "<Plug>(qf_loc_toggle)", desc = "Location list" },
{ "yoq", "<Plug>(qf_qf_toggle)", desc = "Quickfix list" },
{ "yor", desc = "Relative line numbers" },
{ "you", desc = "Cursor column" },
{ "yov", desc = "Virtual editing" },
{ "yow", desc = "Text wrapping" },
{ "yox", desc = "Cursor line and column" },
{ "yoz", desc = "Spell checking" },
} }
wk.add(keys) wk.register(keys)

View file

@ -1,5 +0,0 @@
; extends
; I want to the line added/removed markers to be the correct color
"+" @diff.plus
"-" @diff.minus

View file

@ -40,18 +40,25 @@ in
lualine-lsp-progress # Show progress for LSP servers lualine-lsp-progress # Show progress for LSP servers
# tpope essentials # tpope essentials
vim-commentary # Easy comments
vim-eunuch # UNIX integrations vim-eunuch # UNIX integrations
vim-fugitive # A 'git' wrapper vim-fugitive # A 'git' wrapper
vim-git # Sane git syntax files vim-git # Sane git syntax files
vim-repeat # Enanche '.' for plugins vim-repeat # Enanche '.' for plugins
vim-rsi # Readline mappings vim-rsi # Readline mappings
vim-unimpaired # Some ex command mappings vim-unimpaired # Some ex command mappings
vim-vinegar # Better netrw
# Languages # Languages
rust-vim
vim-beancount vim-beancount
vim-jsonnet
vim-nix
vim-toml
# General enhancements # General enhancements
vim-qf # Better quick-fix list vim-qf # Better quick-fix list
nvim-osc52 # Send clipboard data through terminal escape for SSH
# Other wrappers # Other wrappers
git-messenger-vim # A simple blame window git-messenger-vim # A simple blame window
@ -63,6 +70,7 @@ in
none-ls-nvim # LSP integration for linters and formatters none-ls-nvim # LSP integration for linters and formatters
nvim-treesitter.withAllGrammars # Better highlighting nvim-treesitter.withAllGrammars # Better highlighting
nvim-treesitter-textobjects # More textobjects nvim-treesitter-textobjects # More textobjects
nvim-ts-context-commentstring # Comment string in nested language blocks
plenary-nvim # 'null-ls', 'telescope' dependency plenary-nvim # 'null-ls', 'telescope' dependency
# Completion # Completion
@ -80,7 +88,6 @@ in
dressing-nvim # Integrate native UI hooks with Telescope etc... dressing-nvim # Integrate native UI hooks with Telescope etc...
gitsigns-nvim # Fast git UI integration gitsigns-nvim # Fast git UI integration
nvim-surround # Deal with pairs, now in Lua nvim-surround # Deal with pairs, now in Lua
oil-nvim # Better alternative to NetrW
telescope-fzf-native-nvim # Use 'fzf' fuzzy matching algorithm telescope-fzf-native-nvim # Use 'fzf' fuzzy matching algorithm
telescope-lsp-handlers-nvim # Use 'telescope' for various LSP actions telescope-lsp-handlers-nvim # Use 'telescope' for various LSP actions
telescope-nvim # Fuzzy finder interface telescope-nvim # Fuzzy finder interface
@ -98,11 +105,8 @@ in
nixpkgs-fmt nixpkgs-fmt
# Shell # Shell
bash-language-server shellcheck
shfmt shfmt
# Generic
typos-lsp
]; ];
}; };

View file

@ -1,4 +1,4 @@
-- Use Automake filetype for `local.am` files -- Use Automake filetype for `local.am` files, explicit `set` to force override
vim.filetype.add({ vim.filetype.add({
filename = { filename = {
["local.am"] = "automake", ["local.am"] = "automake",

View file

@ -1,7 +0,0 @@
-- Use GLSL filetype for common shader file extensions
vim.filetype.add({
extension = {
frag = "glsl",
vert = "glsl",
},
})

View file

@ -0,0 +1,6 @@
-- Kbuild is just a Makefile under a different name
vim.filetype.add({
filename = {
["Kbuild"] = "make",
},
})

View file

@ -0,0 +1,6 @@
-- Use LaTeX filetype for TikZ files
vim.filetype.add({
extension = {
tikz = "tex",
},
})

View file

@ -1,4 +1,4 @@
" Basic configuration {{{ " Basic configuraion {{{
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Use UTF-8 " Use UTF-8
set encoding=utf-8 set encoding=utf-8
@ -38,10 +38,10 @@ set tabstop=8
" File parameters {{{ " File parameters {{{
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Disable swap files " Disable backups, we have source control for that
set nobackup
" Disable swapfiles too
set noswapfile set noswapfile
" Enable undo files
set undofile
" }}} " }}}
" UI and UX parameters {{{ " UI and UX parameters {{{
@ -86,29 +86,8 @@ set mouse=
" Set dark mode by default " Set dark mode by default
set background=dark set background=dark
" Setup some overrides for gruvbox " 24 bit colors
lua << EOF set termguicolors
local gruvbox = require("gruvbox")
local colors = gruvbox.palette
gruvbox.setup({
overrides = {
-- Only URLs should be underlined
["@string.special.path"] = { link = "GruvboxOrange" },
-- Revert back to the better diff highlighting
DiffAdd = { fg = colors.green, bg = "NONE" },
DiffChange = { fg = colors.aqua, bg = "NONE" },
DiffDelete = { fg = colors.red, bg = "NONE" },
DiffText = { fg = colors.yellow, bg = colors.bg0 },
-- Directories "pop" better in blue
Directory = { link = "GruvboxBlueBold" },
},
italic = {
-- Comments should not be italic, for e.g: box drawing
comments = false,
},
})
EOF
" Use my preferred colorscheme " Use my preferred colorscheme
colorscheme gruvbox colorscheme gruvbox
" }}} " }}}

Some files were not shown because too many files have changed in this diff Show more