Compare commits

..

No commits in common. "4f0d45e4d54f2a9cca794e68eb76d5d8e7fe7003" and "86eef74e9c35cb553901e8044f791c71b691115a" have entirely different histories.

89 changed files with 1314 additions and 1622 deletions

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
imports = [
./gui-programs.nix
./networking.nix

View file

@ -1,17 +1,12 @@
{
pkgs,
lib,
config,
options,
...
}: let
inherit
(lib)
{ pkgs, lib, config, options, ... }:
let
inherit (lib)
mkEnableOption
mkIf
optional
;
in {
in
{
options.my.gui = {
enable = mkEnableOption "System has some kind of screen attached";
isNvidia = mkEnableOption "System a NVIDIA GPU";
@ -24,9 +19,7 @@ in {
xserver = {
enable = true;
# NOTE: could use `mkOptionDefault` but this feels more explicit
videoDrivers =
if config.my.gui.isNvidia
then ["nvidia"]
videoDrivers = if config.my.gui.isNvidia then [ "nvidia" ]
else options.services.xserver.videoDrivers.default;
windowManager.i3.enable = true;
layout = "fr";
@ -38,8 +31,7 @@ in {
};
environment.systemPackages = builtins.attrValues {
inherit
(pkgs)
inherit (pkgs)
element-desktop
feh
firefox
@ -68,11 +60,11 @@ in {
dispatcherScripts = [
{
source = let
source =
let
grep = "${pkgs.gnugrep}/bin/grep";
nmcli = "${pkgs.networkmanager}/bin/nmcli";
in
pkgs.writeShellScript "disable_wifi_on_ethernet" ''
in pkgs.writeShellScript "disable_wifi_on_ethernet" ''
export LC_ALL=C
enable_disable_wifi ()

View file

@ -1,10 +1,11 @@
{lib, ...}: let
inherit
(lib)
{ lib, ... }:
let
inherit (lib)
mkOption
types
;
in {
in
{
options.my.networking.externalInterface = mkOption {
type = types.nullOr types.str;
default = null;

View file

@ -1,4 +1,5 @@
{pkgs, ...}: {
{ pkgs, ... }:
{
nixpkgs.config.allowUnfree = true;
nix = {

View file

@ -1,4 +1,5 @@
{pkgs, ...}: {
{ pkgs, ... }:
{
programs = {
fish.enable = true;
gnupg.agent = {
@ -19,10 +20,8 @@
};
environment.systemPackages = builtins.attrValues {
inherit
(pkgs)
inherit (pkgs)
# shell usage
fd
ripgrep
sd
@ -30,9 +29,8 @@
tokei
tree
wget
# development
alejandra
# development
git
git-crypt
git-lfs
@ -42,8 +40,8 @@
pinentry-gnome
python3
vim
# terminal utilities
# terminal utilities
bottom
dogdns
du-dust
@ -52,14 +50,14 @@
tealdeer
unzip
zip
# nix pkgs lookup
# nix pkgs lookup
nix-index
agenix
;
inherit
(pkgs.llvmPackages_11)
inherit (pkgs.llvmPackages_11)
bintools
clang
;

View file

@ -1,11 +1,8 @@
{
config,
lib,
pkgs,
...
}: let
{ config, lib, pkgs, ... }:
let
secrets = config.my.secrets;
in {
in
{
users.mutableUsers = false;
users.users.root = {
passwordFile = config.age.secrets."users/root-hashed-password".path;

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
imports = [
# Default configuration
./base

View file

@ -51,14 +51,7 @@
};
};
outputs = {
self,
nixpkgs,
home-manager,
agenix,
...
} @ inputs:
{
outputs = { self, nixpkgs, home-manager, agenix, ... } @inputs: {
nixosModules = {
home = {
home-manager.useGlobalPkgs = true;
@ -75,10 +68,10 @@
overlays = import ./overlays;
nixosConfigurations = let
nixosConfigurations =
let
system = "x86_64-linux";
shared_overlays =
[
shared_overlays = [
(self: super: {
packages = import ./pkgs { pkgs = super; };
@ -87,32 +80,28 @@
inherit system;
config.allowUnfree = true;
};
})
agenix.overlay
]
++ builtins.attrValues self.overlays;
sharedModules =
[
] ++ builtins.attrValues self.overlays;
sharedModules = [
agenix.nixosModule
home-manager.nixosModule
{ nixpkgs.overlays = shared_overlays; }
]
++ (nixpkgs.lib.attrValues self.nixosModules);
] ++ (nixpkgs.lib.attrValues self.nixosModules);
in {
poseidon = nixpkgs.lib.nixosSystem rec {
inherit system;
modules =
[
modules = [
./poseidon.nix
]
++ sharedModules;
] ++ sharedModules;
};
boreal = nixpkgs.lib.nixosSystem rec {
inherit system;
modules =
[
modules = [
./boreal.nix
{
@ -127,14 +116,12 @@
# })
];
}
]
++ sharedModules;
] ++ sharedModules;
};
zephyrus = nixpkgs.lib.nixosSystem rec {
inherit system;
modules =
[
modules = [
./zephyrus.nix
inputs.nixos-hardware.nixosModules.common-cpu-intel
@ -146,26 +133,22 @@
inputs.emacs-overlay.overlay
];
}
]
++ sharedModules;
] ++ sharedModules;
};
};
}
// inputs.flake-utils.lib.eachDefaultSystem (system: {
} // inputs.flake-utils.lib.eachDefaultSystem (system: {
packages =
(
inputs.flake-utils.lib.flattenTree
(import ./pkgs { pkgs = import nixpkgs { inherit system; }; })
)
// {
emacsPgtkGcc =
(
) // {
emacsPgtkGcc = (
import nixpkgs {
inherit system;
overlays = [ inputs.emacs-overlay.overlay ];
}
)
.emacsPgtkGcc;
).emacsPgtkGcc;
};
});
}

View file

@ -1,18 +1,14 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.alacritty;
alacrittyTheme = config.my.theme.alacrittyTheme;
in {
in
{
options.my.home.alacritty.enable = (mkEnableOption "Alacritty terminal") // { default = config.my.home.x.enable; };
config = mkIf cfg.enable {

View file

@ -1,17 +1,14 @@
{
config,
lib,
...
}: let
inherit
(lib)
{ config, lib, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.bat;
batTheme = config.my.theme.batTheme;
in {
in
{
options.my.home.bat = {
enable = (mkEnableOption "bat code display tool") // { default = true; };
};

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
imports = [
./alacritty.nix
./bat.nix

View file

@ -1,32 +1,27 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;
in {
in
{
options.my.home.emacs = {
enable = mkEnableOption "Emacs daemon configuration";
};
config = mkIf config.my.home.emacs.enable {
home.sessionPath = [ "${config.xdg.configHome}/emacs/bin" ];
home.sessionVariables = {
EDITOR = "emacsclient -t";
};
home.packages = builtins.attrValues {
inherit
(pkgs)
inherit (pkgs)
sqlite # needed by org-roam
# fonts used by my config
emacs-all-the-icons-fonts
iosevka-bin
;

View file

@ -1,4 +1,5 @@
{config, ...}: {
{ config, ... }:
{
home.sessionPath = [
"${config.home.homeDirectory}/.cargo/bin"
"${config.home.homeDirectory}/.local/bin"

View file

@ -1,17 +1,13 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.firefox;
in {
in
{
options.my.home.firefox = {
enable = (mkEnableOption "firefox config") // { default = config.my.home.x.enable; };
};

View file

@ -1,16 +1,13 @@
{
config,
lib,
...
}: let
inherit
(lib)
{ config, lib, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.fish;
in {
in
{
options.my.home.fish.enable = (mkEnableOption "Fish shell") // { default = true; };
config = mkIf cfg.enable {

View file

@ -1,16 +1,13 @@
{
config,
lib,
...
}: let
inherit
(lib)
{ config, lib, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.flameshot;
in {
in
{
options.my.home.flameshot = {
enable = mkEnableOption "flameshot autolaunch";
};

View file

@ -1,17 +1,13 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.git;
in {
in
{
options.my.home.git.enable = (mkEnableOption "Git configuration") // { default = true; };
config = mkIf cfg.enable {

View file

@ -1,13 +1,10 @@
{
config,
lib,
...
}: let
inherit
(lib)
{ config, lib, ... }:
let
inherit (lib)
mkEnableOption
;
in {
in
{
options.my.home.laptop = {
enable = mkEnableOption "Laptop settings";
};

View file

@ -1,16 +1,13 @@
{
config,
lib,
...
}: let
inherit
(lib)
{ config, lib, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.lorri;
in {
in
{
options.my.home.lorri = {
enable = (mkEnableOption "lorri daemon setup") // { default = true; };
};

View file

@ -1,11 +1,6 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;
@ -15,7 +10,8 @@
email_lrde = "amartin@lrde.epita.fr";
cfg = config.my.home.mail;
in {
in
{
options.my.home.mail = {
# I *could* read email in a terminal emacs client on a server, but in
# practice I don't think it'll happen very often, so let's enable this only

View file

@ -1,18 +1,14 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.mail;
in {
in
{
options.my.home.rbw = {
enable = mkEnableOption "rbw configuration";
enable = (mkEnableOption "rbw configuration");
};
config = mkIf cfg.enable {

View file

@ -1,17 +1,13 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.rofi;
in {
in
{
options.my.home.rofi = {
enable = (mkEnableOption "rofi configuration") // { default = config.my.home.x.enable; };
};

View file

@ -1,16 +1,13 @@
{
config,
lib,
...
}: let
inherit
(lib)
{ config, lib, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.ssh;
in {
in
{
options.my.home.ssh = {
enable = (mkEnableOption "ssh configuration") // { default = true; };
};

View file

@ -1,6 +1,6 @@
{lib}: let
inherit
(lib)
{ lib }:
let
inherit (lib)
mkOption
types
;

View file

@ -1,6 +1,6 @@
{lib}: let
inherit
(lib)
{ lib }:
let
inherit (lib)
mkOption
types
;

View file

@ -1,15 +1,11 @@
{lib}: let
inherit
(lib)
{ lib }:
let
inherit (lib)
mkOption
types
;
mkColorOption = {
default ? "#000000",
description ? "",
}:
mkOption {
mkColorOption = {default ? "#000000", description ? "" }: mkOption {
inherit description default;
example = "#abcdef";
type = types.strMatching "#[0-9a-f]{6}";

View file

@ -1,10 +1,6 @@
{
config,
lib,
...
}: let
inherit
(lib)
{ config, lib, ... }:
let
inherit (lib)
mkOption
types
;
@ -29,7 +25,8 @@
};
};
};
in {
in
{
options.my.theme = mkOption {
type = themeType;
default = {};

View file

@ -1,6 +1,6 @@
{lib}: let
inherit
(lib)
{ lib }:
let
inherit (lib)
mkOption
types
;
@ -102,7 +102,8 @@ in
background = "#900000";
text = "#ffffff";
};
description = "Border, background and text color for the binding mode indicator";
description =
"Border, background and text color for the binding mode indicator";
};
};
};

View file

@ -1,6 +1,6 @@
{lib}: let
inherit
(lib)
{ lib }:
let
inherit (lib)
mkOption
types
;

View file

@ -1,6 +1,5 @@
let
inherit
(import ./colors.nix)
inherit (import ./colors.nix)
base0
base00
base01
@ -18,7 +17,8 @@ let
violet
yellow
;
in {
in
{
primary = {
background = base3;
foreground = base00;

View file

@ -1,6 +1,5 @@
let
inherit
(import ./colors.nix)
inherit (import ./colors.nix)
base00
base2
base3
@ -10,7 +9,8 @@ let
red
yellow
;
in {
in
{
bar = {
background = base3;
statusline = yellow;

View file

@ -1,6 +1,5 @@
let
inherit
(import ./colors.nix)
inherit (import ./colors.nix)
base00
base2
base3
@ -9,7 +8,8 @@ let
red
yellow
;
in {
in
{
theme = {
name = "solarized-light";
overrides = {

View file

@ -1,17 +1,13 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.tmux;
in {
in
{
options.my.home.tmux = {
enable = (mkEnableOption "tmux dotfiles") // { default = true; };
};
@ -23,9 +19,7 @@ in {
terminal = "screen-256color";
clock24 = true;
plugins = let
inherit (pkgs) tmuxPlugins;
in [
plugins = let inherit (pkgs) tmuxPlugins; in [
{
plugin = tmuxPlugins.cpu;
extraConfig = ''

View file

@ -1,16 +1,13 @@
{
config,
lib,
...
}: let
inherit
(lib)
{ config, lib, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.tridactyl;
in {
in
{
options.my.home.tridactyl = {
enable = (mkEnableOption "tridactyl code display tool") // { default = config.my.home.firefox.enable; };
};

View file

@ -1,17 +1,13 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.home.x.cursor;
in {
in
{
options.my.home.x.cursor.enable = (mkEnableOption "X cursor") // { default = config.my.home.x.enable; };
config = mkIf cfg.enable {

View file

@ -1,14 +1,10 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
;
in {
in
{
imports = [
./cursor.nix
./i3.nix

View file

@ -1,11 +1,6 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkIf
mkOptionDefault
;
@ -25,7 +20,8 @@
logoutMode = "[L]ogout, [S]uspend, [P]oweroff, [R]eboot";
i3Theme = config.my.theme.i3Theme;
in {
in
{
config = mkIf isEnabled {
my.home = {
flameshot.enable = true;
@ -39,10 +35,12 @@ in {
config = {
inherit modifier;
bars = let
bars =
let
barConfigPath =
config.xdg.configFile."i3status-rust/config-top.toml".target;
in [
in
[
{
statusCommand = "i3status-rs ${barConfigPath}";
position = "top";
@ -64,8 +62,7 @@ in {
];
colors = {
inherit
(i3Theme)
inherit (i3Theme)
focused
focusedInactive
unfocused
@ -107,10 +104,9 @@ in {
"${modifier}+d" = "exec ${pkgs.rofi}/bin/rofi -show run";
};
modes = let
makeModeBindings = attrs:
attrs
// {
modes =
let
makeModeBindings = attrs: attrs // {
"Escape" = "mode default";
"Return" = "mode default";
};
@ -134,10 +130,7 @@ in {
};
window.commands = [
{
command = "border pixel 2";
criteria = {class = "Alacritty";};
}
{ command = "border pixel 2"; criteria = { class = "Alacritty"; }; }
# NOTE: should be done with an assign command, but Spotify doesn't set
# its class until after initialization, so has to be done this way.

View file

@ -1,11 +1,6 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
lists
mkIf
mkOption
@ -16,7 +11,8 @@
isEnabled = config.my.home.x.enable;
i3BarTheme = config.my.theme.i3BarTheme;
cfg = config.my.home.x.i3bar;
in {
in
{
options.my.home.x.i3bar = {
temperature.chip = mkOption {
type = types.str;
@ -38,10 +34,8 @@ in {
config = mkIf isEnabled {
home.packages = builtins.attrValues {
inherit
(pkgs)
inherit (pkgs)
# FIXME: is this useful?
font-awesome
;
};
@ -55,8 +49,7 @@ in {
theme = i3BarTheme.theme.name;
settings = i3BarTheme;
blocks =
[
blocks = [
{
block = "pomodoro";
length = 60;
@ -95,19 +88,18 @@ in {
chip = cfg.temperature.chip;
inputs = cfg.temperature.inputs;
}
]
++ (
lists.optionals ((builtins.length cfg.networking.throughput_interfaces) != 0)
] ++ (lists.optionals ((builtins.length cfg.networking.throughput_interfaces) != 0)
(map
(interface: {
(interface:
{
block = "net";
device = interface;
interval = 1;
hide_inactive = true;
})
cfg.networking.throughput_interfaces)
)
++ [
) ++ [
{
block = "networkmanager";
primary_only = true;
@ -116,14 +108,11 @@ in {
block = "sound";
driver = "pulseaudio";
}
]
++ (
optional config.my.home.laptop.enable
] ++ (optional config.my.home.laptop.enable
{
block = "battery";
}
)
++ [
) ++ [
# {
# block = "notify";
# }

View file

@ -1,14 +1,11 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}: {
imports = [
# Include the results of the hardware scan.
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./home.nix

View file

@ -1,15 +1,11 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
@ -17,14 +13,14 @@
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/1a942915-c1ae-4058-b99d-09d12d40dbd3";
fileSystems."/" =
{ device = "/dev/disk/by-uuid/1a942915-c1ae-4058-b99d-09d12d40dbd3";
fsType = "btrfs";
options = [ "subvol=nixos" "compress=zstd:1" "noatime" ];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/17C7-368D";
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/17C7-368D";
fsType = "vfat";
};

View file

@ -1,8 +1,5 @@
{ config, pkgs, ... }:
{
config,
pkgs,
...
}: {
home-manager.users.alarsyo = {
# Keyboard settings & i3 settings
my.home.x.enable = true;
@ -14,16 +11,14 @@
my.theme = config.home-manager.users.alarsyo.my.themes.solarizedLight;
home.packages = builtins.attrValues {
inherit
(pkgs)
inherit (pkgs)
# some websites only work there :(
chromium
# dev
rustup
# keyboard goodness
# keyboard goodness
chrysalis
;

View file

@ -1,16 +1,12 @@
{ config, lib, options, ... }:
{
config,
lib,
options,
...
}: {
config.age = {
secrets = let
toSecret = name: {...} @ attrs:
{
secrets =
let
toSecret = name: { ... }@attrs: {
file = ./../../modules/secrets + "/${name}.age";
}
// attrs;
} // attrs;
in
lib.mapAttrs toSecret {
"restic-backup/boreal-credentials" = {};

View file

@ -1,16 +1,14 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{
config,
lib,
pkgs,
...
}: let
{ config, lib, pkgs, ... }:
let
secrets = config.my.secrets;
in {
imports = [
# Include the results of the hardware scan.
in
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./home.nix

View file

@ -1,20 +1,15 @@
# 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,
...
}: let
inherit
(lib)
{ config, lib, pkgs, modulesPath, ... }:
let
inherit (lib)
mkDefault
;
in {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
in
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "ahci" "usbhid" ];
@ -22,8 +17,8 @@ in {
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/adcf0158-edfb-402f-82e7-61e4902af989";
fileSystems."/" =
{ device = "/dev/disk/by-uuid/adcf0158-edfb-402f-82e7-61e4902af989";
fsType = "btrfs";
options = [
"subvol=@nixos"
@ -32,13 +27,13 @@ in {
];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/ff54b622-0e26-4c6e-aa0c-ac2c1e12699a";
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/ff54b622-0e26-4c6e-aa0c-ac2c1e12699a";
fsType = "ext4";
};
swapDevices = [
{device = "/dev/disk/by-uuid/381a9c5e-4d71-45b4-ac62-e7414b3768fc";}
swapDevices =
[ { device = "/dev/disk/by-uuid/381a9c5e-4d71-45b4-ac62-e7414b3768fc"; }
];
powerManagement.cpuFreqGovernor = mkDefault "ondemand";

View file

@ -1,5 +1,7 @@
{config, ...}: {
{ config, ... }:
{
home-manager.users.alarsyo = {
my.theme = config.home-manager.users.alarsyo.my.themes.solarizedLight;
};
}

View file

@ -1,16 +1,12 @@
{ config, lib, options, ... }:
{
config,
lib,
options,
...
}: {
config.age = {
secrets = let
toSecret = name: {...} @ attrs:
{
secrets =
let
toSecret = name: { ... }@attrs: {
file = ./../../modules/secrets + "/${name}.age";
}
// attrs;
} // attrs;
in
lib.mapAttrs toSecret {
"gandi/api-key" = {};

View file

@ -1,14 +1,11 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}: {
imports = [
# Include the results of the hardware scan.
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./home.nix
./secrets.nix

View file

@ -1,20 +1,15 @@
# 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,
...
}: let
inherit
(lib)
{ config, lib, pkgs, modulesPath, ... }:
let
inherit (lib)
mkDefault
;
in {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
in
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
@ -22,29 +17,29 @@ in {
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/6395cef1-c30b-450a-917c-cfb3c0380642";
fileSystems."/" =
{ device = "/dev/disk/by-uuid/6395cef1-c30b-450a-917c-cfb3c0380642";
fsType = "btrfs";
options = [ "subvol=@" "compress=zstd" "noatime" ];
};
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/c59e7067-e33c-474c-9b8e-96d0e8f59297";
fileSystems."/home" = {
device = "/dev/disk/by-uuid/6395cef1-c30b-450a-917c-cfb3c0380642";
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/6395cef1-c30b-450a-917c-cfb3c0380642";
fsType = "btrfs";
options = [ "subvol=@home" "compress=zstd" "noatime" ];
neededForBoot = true; # agenix needs my key for some root secrets
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/6395cef1-c30b-450a-917c-cfb3c0380642";
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/6395cef1-c30b-450a-917c-cfb3c0380642";
fsType = "btrfs";
options = [ "subvol=@nix" "compress=zstd" "noatime" ];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/D9DA-F46C";
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/D9DA-F46C";
fsType = "vfat";
};

View file

@ -1,8 +1,5 @@
{ config, pkgs, ... }:
{
config,
pkgs,
...
}: {
home-manager.users.alarsyo = {
my.home.laptop.enable = true;
@ -16,14 +13,13 @@
my.theme = config.home-manager.users.alarsyo.my.themes.solarizedLight;
home.packages = builtins.attrValues {
inherit
(pkgs)
inherit (pkgs)
# some websites only work there :(
chromium
darktable
# dev
darktable
# dev
rustup
;

View file

@ -1,16 +1,12 @@
{ config, lib, options, ... }:
{
config,
lib,
options,
...
}: {
config.age = {
secrets = let
toSecret = name: {...} @ attrs:
{
secrets =
let
toSecret = name: { ... }@attrs: {
file = ./../../modules/secrets + "/${name}.age";
}
// attrs;
} // attrs;
in
lib.mapAttrs toSecret {
"restic-backup/zephyrus-credentials" = {};

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
imports = [
./sddm.nix
./secrets

View file

@ -1,17 +1,13 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.displayManager.sddm;
in {
in
{
options.my.displayManager.sddm.enable = mkEnableOption "SDDM setup";
config = mkIf cfg.enable {
@ -21,13 +17,11 @@ in {
};
environment.systemPackages = builtins.attrValues {
inherit
(pkgs.packages)
inherit (pkgs.packages)
sddm-sugar-candy
;
inherit
(pkgs.libsForQt5.qt5)
inherit (pkgs.libsForQt5.qt5)
qtgraphicaleffects
qtquickcontrols2
qtsvg

View file

@ -1,13 +1,8 @@
{ config, lib, options, ... }:
{
config,
lib,
options,
...
}: {
config.age = {
identityPaths =
options.age.identityPaths.default
++ [
identityPaths = options.age.identityPaths.default ++ [
"/home/alarsyo/.ssh/id_ed25519"
];
};

View file

@ -9,7 +9,8 @@ let
machines = [ boreal poseidon zephyrus ];
all = users ++ machines;
in {
in
{
"gandi/api-key.age".publicKeys = [ poseidon ];
"lohr/shared-secret.age".publicKeys = [ poseidon ];

View file

@ -1,11 +1,7 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
concatStringsSep
literalExample
mapAttrs'
@ -29,10 +25,9 @@
${pkgs.iw}/bin/iw ${name} wowlan enable ${concatStringsSep " " cfg.methods}
'';
};
in {
options.my.wakeonwlan = let
inherit (lib) types;
in {
in
{
options.my.wakeonwlan = let inherit (lib) types; in {
interfaces = mkOption {
default = { };
description = "Wireless interfaces where you want to enable WoWLAN";

View file

@ -1,4 +1,5 @@
final: prev: {
final: prev:
{
# overlay created because nixpkgs's `i3status-rust` depended on `notmuch`, and
# `notmuch`'s tests were briefly broken. the features I'm disabling, I don't
# need anyway: (at the time of writing)
@ -7,8 +8,7 @@ final: prev: {
# - maildir
i3status-rust = prev.i3status-rust.overrideAttrs (oldAttrs: {
buildInputs = builtins.attrValues {
inherit
(final)
inherit (final)
dbus
lm_sensors
openssl

View file

@ -1,4 +1,5 @@
{pkgs}: {
{ pkgs }:
{
sddm-sugar-candy = pkgs.callPackage ./sddm-sugar-candy {};
kaleidoscope-udev-rules = pkgs.callPackage ./kaleidoscope-udev-rules {};
grafanaDashboards = pkgs.recurseIntoAttrs (pkgs.callPackage ./grafana-dashboards {});

View file

@ -1,4 +1,5 @@
{callPackage}: {
{ callPackage }:
{
nginx = callPackage ./nginx.nix {};
node-exporter = callPackage ./node-exporter.nix {};
}

View file

@ -1,11 +1,6 @@
{
stdenv,
fetchFromGitHub,
lib,
...
}: let
inherit
(lib)
{ stdenv, fetchFromGitHub, lib, ... }:
let
inherit (lib)
licenses
;

View file

@ -1,11 +1,6 @@
{
stdenv,
fetchFromGitHub,
lib,
...
}: let
inherit
(lib)
{ stdenv, fetchFromGitHub, lib, ... }:
let
inherit (lib)
licenses
;

View file

@ -1,10 +1,7 @@
{
stdenv,
lib,
fetchFromGitHub,
}: let
inherit
(lib)
{ stdenv, lib, fetchFromGitHub }:
let
inherit (lib)
licenses
;

View file

@ -1,7 +1,4 @@
{
stdenv,
fetchFromGitLab,
}:
{ stdenv, fetchFromGitLab }:
stdenv.mkDerivation rec {
pname = "sddm-sugar-candy";
# latest master commit, no recent tags :(

View file

@ -1,8 +1,8 @@
{
stdenv,
fetchurl,
python3,
}: let
{ stdenv
, fetchurl
, python3
}:
let
version = "2.10.4";
in
stdenv.mkDerivation {

View file

@ -1,4 +1,6 @@
{...}: {
{ ... }:
{
imports = [
# Default configuration
./base

View file

@ -1,4 +1,6 @@
{...}: {
{ ... }:
{
imports = [
./vaultwarden.nix
./fail2ban.nix

View file

@ -1,11 +1,7 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;

View file

@ -1,11 +1,7 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
mkOption
@ -15,10 +11,9 @@
my = config.my;
domain = config.networking.domain;
secrets = config.my.secrets;
in {
options.my.services.fava = let
inherit (lib) types;
in {
in
{
options.my.services.fava = let inherit (lib) types; in {
enable = mkEnableOption "Fava";
home = mkOption {

View file

@ -1,11 +1,7 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
mkOption
@ -16,9 +12,7 @@
domain = config.networking.domain;
in {
options.my.services.gitea = let
inherit (lib) types;
in {
options.my.services.gitea = let inherit (lib) types; in {
enable = mkEnableOption "Personal Git hosting with Gitea";
privatePort = mkOption {

View file

@ -1,11 +1,7 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;

View file

@ -1,11 +1,7 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
mkOption
@ -15,14 +11,14 @@
my = config.my;
domain = config.networking.domain;
secrets = config.my.secrets;
lohrPkg = let
lohrPkg =
let
flake = builtins.getFlake "github:alarsyo/lohr?rev=58503cc8b95c8b627f6ae7e56740609e91f323cd";
in
flake.defaultPackage."x86_64-linux"; # FIXME: use correct system
in {
options.my.services.lohr = let
inherit (lib) types;
in {
in
{
options.my.services.lohr = let inherit (lib) types; in {
enable = mkEnableOption "Lohr Mirroring Daemon";
home = mkOption {

View file

@ -7,14 +7,10 @@
# - https://github.com/delroth/infra.delroth.net/blob/master/roles/matrix-synapse.nix
# - https://nixos.org/manual/nixos/stable/index.html#module-services-matrix
#
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
mkOption
@ -24,19 +20,11 @@
cfg = config.my.services.matrix;
my = config.my;
federationPort = {
public = 8448;
private = 11338;
};
clientPort = {
public = 443;
private = 11339;
};
federationPort = { public = 8448; private = 11338; };
clientPort = { public = 443; private = 11339; };
domain = config.networking.domain;
in {
options.my.services.matrix = let
inherit (lib) types;
in {
options.my.services.matrix = let inherit (lib) types; in {
enable = mkEnableOption "Matrix Synapse";
secretConfigFile = mkOption {
@ -106,12 +94,7 @@ in {
port = federationPort.private;
tls = false; # Terminated by nginx.
x_forwarded = true;
resources = [
{
names = ["federation"];
compress = false;
}
];
resources = [ { names = [ "federation" ]; compress = false; } ];
}
# Client
@ -120,12 +103,7 @@ in {
port = clientPort.private;
tls = false; # Terminated by nginx.
x_forwarded = true;
resources = [
{
names = ["client"];
compress = false;
}
];
resources = [ { names = [ "client" ]; compress = false; } ];
}
];
@ -149,7 +127,8 @@ in {
onlySSL = true;
useACMEHost = domain;
locations = let
locations =
let
proxyToClientPort = {
proxyPass = "http://[::1]:${toString clientPort.private}";
};
@ -164,17 +143,10 @@ in {
};
listen = [
{
addr = "0.0.0.0";
port = clientPort.public;
ssl = true;
}
{
addr = "[::]";
port = clientPort.public;
ssl = true;
}
{ addr = "0.0.0.0"; port = clientPort.public; ssl = true; }
{ addr = "[::]"; port = clientPort.public; ssl = true; }
];
};
# same as above, but listening on the federation port
@ -190,31 +162,26 @@ in {
};
listen = [
{
addr = "0.0.0.0";
port = federationPort.public;
ssl = true;
}
{
addr = "[::]";
port = federationPort.public;
ssl = true;
}
{ addr = "0.0.0.0"; port = federationPort.public; ssl = true; }
{ addr = "[::]"; port = federationPort.public; ssl = true; }
];
};
"${domain}" = {
forceSSL = true;
useACMEHost = domain;
locations."= /.well-known/matrix/server".extraConfig = let
locations."= /.well-known/matrix/server".extraConfig =
let
server = { "m.server" = "matrix.${domain}:${toString federationPort.public}"; };
in ''
add_header Content-Type application/json;
return 200 '${builtins.toJSON server}';
'';
locations."= /.well-known/matrix/client".extraConfig = let
locations."= /.well-known/matrix/client".extraConfig =
let
client = {
"m.homeserver" = { "base_url" = "https://matrix.${domain}"; };
"m.identity_server" = { "base_url" = "https://vector.im"; };
@ -269,8 +236,7 @@ in {
my.services.restic-backup = let
dataDir = config.services.matrix-synapse.dataDir;
in
mkIf cfg.enable {
in mkIf cfg.enable {
paths = [ dataDir ];
# this is just caching for other servers media, doesn't need backup
exclude = [ "${dataDir}/media/remote_*" ];

View file

@ -1,21 +1,17 @@
{
config,
lib,
...
}: let
inherit
(lib)
{ config, lib, ... }:
let
inherit (lib)
mkIf
;
mediaServices = builtins.attrValues {
inherit
(config.my.services)
inherit (config.my.services)
jellyfin
transmission
;
};
needed = builtins.any (service: service.enable) mediaServices;
in {
in
{
config.users.groups.media = mkIf needed { };
}

View file

@ -1,11 +1,7 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
mkOption
@ -16,9 +12,7 @@
domain = config.networking.domain;
in {
options.my.services.miniflux = let
inherit (lib) types;
in {
options.my.services.miniflux = let inherit (lib) types; in {
enable = mkEnableOption "Serve a Miniflux instance";
adminCredentialsFile = mkOption {

View file

@ -1,11 +1,7 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
mkOption
@ -14,9 +10,7 @@
cfg = config.my.services.monitoring;
domain = config.networking.domain;
in {
options.my.services.monitoring = let
inherit (lib) types;
in {
options.my.services.monitoring = let inherit (lib) types; in {
enable = mkEnableOption "Enable monitoring";
domain = mkOption {
@ -93,11 +87,9 @@ in {
scrapeConfigs = [
{
job_name = config.networking.hostName;
static_configs = [
{
static_configs = [{
targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" ];
}
];
}];
}
];
};

View file

@ -1,11 +1,7 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
mkOption
@ -15,9 +11,7 @@
cfg = config.my.services.navidrome;
domain = config.networking.domain;
in {
options.my.services.navidrome = let
inherit (lib) types;
in {
options.my.services.navidrome = let inherit (lib) types; in {
enable = mkEnableOption "Navidrome";
musicFolder = {
path = mkOption {

View file

@ -1,13 +1,9 @@
{
lib,
config,
pkgs,
...
}:
{ lib, config, pkgs, ... }:
# TODO: setup prometheus exporter
let
inherit
(lib)
inherit (lib)
mkEnableOption
mkIf
mkOption
@ -17,10 +13,9 @@ let
my = config.my;
domain = config.networking.domain;
dbName = "nextcloud";
in {
options.my.services.nextcloud = let
inherit (lib) types;
in {
in
{
options.my.services.nextcloud = let inherit (lib) types; in {
enable = mkEnableOption "NextCloud";
adminpassFile = mkOption {
@ -92,8 +87,7 @@ in {
my.services.restic-backup = let
nextcloudHome = config.services.nextcloud.home;
in
mkIf cfg.enable {
in mkIf cfg.enable {
paths = [ nextcloudHome ];
exclude = [
# borg can fail if *.part files disappear during backup

View file

@ -1,17 +1,13 @@
# Part of config shamelessly stolen from:
#
# https://github.com/delroth/infra.delroth.net
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkIf
;
in {
in
{
# Whenever something defines an nginx vhost, ensure that nginx defaults are
# properly set.
config = mkIf ((builtins.attrNames config.services.nginx.virtualHosts) != [ "localhost" ]) {
@ -36,14 +32,12 @@ in {
scrapeConfigs = [
{
job_name = "nginx";
static_configs = [
{
static_configs = [{
targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.nginx.port}" ];
labels = {
instance = config.networking.hostName;
};
}
];
}];
}
];
};
@ -52,7 +46,8 @@ in {
acceptTerms = true;
defaults.email = "antoine97.martin@gmail.com";
certs = let
certs =
let
domain = config.networking.domain;
gandiKey = config.my.secrets.gandiKey;
in {

View file

@ -1,17 +1,15 @@
{
config,
lib,
...
}: let
inherit
(lib)
{ config, lib, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.services.nuage;
my = config.my;
in {
in
{
options.my.services.nuage = {
enable = mkEnableOption "Nuage redirect";
};

View file

@ -1,11 +1,7 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
mkOption
@ -15,10 +11,9 @@
my = config.my;
domain = config.networking.domain;
paperlessDomain = "paperless.${domain}";
in {
options.my.services.paperless = let
inherit (lib) types;
in {
in
{
options.my.services.paperless = let inherit (lib) types; in {
enable = mkEnableOption "Paperless";
port = mkOption {

View file

@ -1,12 +1,7 @@
{
config,
lib,
pkgs,
options,
...
}: let
inherit
(lib)
{ config, lib, pkgs, options, ... }:
let
inherit (lib)
mkEnableOption
mkIf
optionalAttrs
@ -14,7 +9,8 @@
cfg = config.my.services.pipewire;
my = config.my;
in {
in
{
options.my.services.pipewire = {
enable = mkEnableOption "Pipewire sound backend";
};

View file

@ -1,11 +1,7 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;
@ -31,4 +27,5 @@ in {
exclude = [ "/var/backup/postgresql/*.prev.sql.gz" ];
};
};
}

View file

@ -1,8 +1,5 @@
{ config, pkgs, ... }:
{
config,
pkgs,
...
}: {
# set postgresql version so we don't get any bad surprise
config.services.postgresql = {
package = pkgs.postgresql_13;

View file

@ -1,11 +1,7 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
attrsets
concatStringsSep
mkEnableOption
@ -19,9 +15,7 @@
makePruneOpts = pruneOpts:
attrsets.mapAttrsToList (name: value: "--keep-${name} ${toString value}") pruneOpts;
in {
options.my.services.restic-backup = let
inherit (lib) types;
in {
options.my.services.restic-backup = let inherit (lib) types; in {
enable = mkEnableOption "Enable Restic backups for this host";
repo = mkOption {
@ -29,6 +23,7 @@ in {
default = null;
example = "/mnt/hdd";
description = "Restic backup repo";
};
paths = mkOption {
@ -97,8 +92,7 @@ in {
passwordFile = cfg.passwordFile;
environmentFile = cfg.environmentFile;
extraBackupArgs =
["--verbose=2"]
extraBackupArgs = [ "--verbose=2" ]
++ optional (builtins.length cfg.exclude != 0) excludeArg;
timerConfig = cfg.timerConfig;

View file

@ -1,17 +1,14 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.services.tailscale;
in {
in
{
options.my.services.tailscale = {
enable = mkEnableOption "Tailscale";

View file

@ -1,17 +1,15 @@
{
config,
lib,
...
}: let
inherit
(lib)
{ config, lib, ... }:
let
inherit (lib)
mkEnableOption
mkIf
;
cfg = config.my.services.tgv;
my = config.my;
in {
in
{
options.my.services.tgv = {
enable = mkEnableOption "TGV redirect";
};

View file

@ -1,10 +1,6 @@
{
config,
lib,
...
}: let
inherit
(lib)
{ config, lib, ... }:
let
inherit (lib)
mkEnableOption
mkIf
mkOption
@ -20,10 +16,9 @@
transmissionPeerPort = 30251;
downloadBase = "/media/torrents/";
in {
options.my.services.transmission = let
inherit (lib) types;
in {
in
{
options.my.services.transmission = let inherit (lib) types; in {
enable = mkEnableOption "Transmission torrent client";
username = mkOption {
@ -42,8 +37,7 @@ in {
};
config = mkIf cfg.enable {
services.transmission =
{
services.transmission = {
enable = true;
group = "media";
@ -66,8 +60,7 @@ in {
# automatically allow transmission.settings.peer-port
openFirewall = true;
}
// (optionalAttrs (cfg.secretConfigFile != null) {
} // (optionalAttrs (cfg.secretConfigFile != null) {
credentialsFile = cfg.secretConfigFile;
});

View file

@ -1,11 +1,7 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
{ config, lib, pkgs, ... }:
let
inherit (lib)
mkEnableOption
mkIf
mkOption
@ -16,9 +12,7 @@
domain = config.networking.domain;
in {
options.my.services.vaultwarden = let
inherit (lib) types;
in {
options.my.services.vaultwarden = let inherit (lib) types; in {
enable = mkEnableOption "Vaultwarden";
privatePort = mkOption {
@ -125,4 +119,5 @@ in {
'';
};
};
}

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
imports = [
# Default configuration
./base