Compare commits

..

No commits in common. "main" and "push-yqlvnukzxvnn" have entirely different histories.

89 changed files with 1437 additions and 2870 deletions

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
let
passwordFile = "/tmp/dotfiles_${config.frogeye.name}_password";
in
@ -46,24 +41,15 @@ in
subvolumes = {
"/nixos" = {
mountpoint = "/";
mountOptions = [
"compress=zstd"
"noatime"
];
mountOptions = [ "compress=zstd" "noatime" ];
};
"/home" = {
mountpoint = "/home";
mountOptions = [
"compress=zstd"
"relatime"
];
mountOptions = [ "compress=zstd" "relatime" ];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [
"compress=zstd"
"noatime"
];
mountOptions = [ "compress=zstd" "noatime" ];
};
# Maybe later
# "/swap" = {

View file

@ -1,2 +1,2 @@
{ pkgs, ... }:
pkgs.writers.writePython3Bin "update-local-flakes" { } (builtins.readFile ./update-local-flakes.py)
pkgs.writers.writePython3Bin "update-local-flakes" {} (builtins.readFile ./update-local-flakes.py)

View file

@ -1,3 +1,3 @@
(self: super: {
update-local-flakes = super.callPackage ./. { };
update-local-flakes = super.callPackage ./. {};
})

View file

@ -1,14 +1,8 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = {
frogeye.name = "cranberry";
disko.devices.disk."${config.frogeye.name
}".device = "/dev/disk/by-id/nvme-UMIS_RPJTJ128MEE1MWX_SS0L25188X3RC12121TP";
disko.devices.disk."${config.frogeye.name}".device = "/dev/disk/by-id/nvme-UMIS_RPJTJ128MEE1MWX_SS0L25188X3RC12121TP";
};
imports = [
../common/disko/single_uefi_btrfs.nix

View file

@ -1,25 +1,10 @@
{
pkgs,
lib,
config,
nixos-hardware,
...
}:
{ pkgs, lib, config, nixos-hardware, ... }:
{
config = {
boot = {
# From nixos-generate-config
initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"usb_storage"
"sd_mod"
"sdhci_pci"
];
initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" "sdhci_pci" ];
kernelModules = [ "kvm-amd" ];
# Times tpm2.target times out waiting for /dev/tpmrm0,
# it's fine after unlocking though
initrd.systemd.tpm2.enable = false;
};
# Needed for Wi-Fi
@ -46,14 +31,9 @@
};
# Alt key swallowed the Meta one
home-manager.users.geoffrey =
{ ... }:
{
xsession.windowManager.i3.config.modifier = "Mod1";
};
# 8 makes it run out of memory when rebuilding.
nix.settings.max-jobs = 1;
home-manager.users.geoffrey = { ... }: {
xsession.windowManager.i3.config.modifier = "Mod1";
};
};
imports = [

View file

@ -2,25 +2,13 @@
# MANU Snapper is not able to create the snapshot directory, so you'll need to do this after eventually running the backup script:
# sudo btrfs subvol create /mnt/razmo/$subvolume/.snapshots
let
backup_subvolumes = [
"nixos"
"home.rapido"
"home.nixos"
];
backup_subvolumes = [ "nixos" "home.rapido" "home.nixos" ];
backup_app = pkgs.writeShellApplication {
name = "backup-subvolume";
runtimeInputs = with pkgs; [
coreutils
btrfs-progs
];
runtimeInputs = with pkgs; [ coreutils btrfs-progs ];
text = builtins.readFile ./backup.sh;
};
snapper_subvolumes = [
"nixos"
"home.rapido"
"home.razmo"
"home.nixos"
];
snapper_subvolumes = [ "nixos" "home.rapido" "home.razmo" "home.nixos" ];
in
{
services =
@ -51,15 +39,10 @@ in
};
in
{
snapper.configs = lib.attrsets.mergeAttrsList (
map (s: {
"${s}" = default // {
SUBVOLUME = "/mnt/razmo/${s}";
};
}) snapper_subvolumes
);
snapper.configs = lib.attrsets.mergeAttrsList (map (s: { "${s}" = default // { SUBVOLUME = "/mnt/razmo/${s}"; }; }) snapper_subvolumes);
};
systemd = {
services.bkp_rapido = {
description = "Make a snapshot of the SSD to the HDD";

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
let
zytemp_mqtt_src = pkgs.fetchFromGitHub {
# owner = "patrislav1";
@ -12,15 +7,12 @@ let
rev = "push-nurpouorqoyr"; # Humidity + availability support
sha256 = "sha256-nOhyBAgvjeQh9ys3cBJOVR67SDs96zBzxIRGpaq4yoA=";
};
zytemp_mqtt = pkgs.python3Packages.buildPythonPackage rec {
name = "zytemp_mqtt";
src = zytemp_mqtt_src;
propagatedBuildInputs = with pkgs.python3Packages; [
hidapi
paho-mqtt
pyaml
];
};
zytemp_mqtt = pkgs.python3Packages.buildPythonPackage
rec {
name = "zytemp_mqtt";
src = zytemp_mqtt_src;
propagatedBuildInputs = with pkgs.python3Packages; [ hidapi paho-mqtt pyaml ];
};
usb_zytemp_udev = pkgs.stdenv.mkDerivation {
pname = "usb-zytemp-udev-rules";
version = "unstable-2023-05-24";
@ -71,11 +63,7 @@ in
RestrictRealtime = true;
RestrictSUIDSGID = true;
SystemCallArchitectures = "native";
SystemCallFilter = [
"@system-service"
"~@privileged"
"~@resouces"
];
SystemCallFilter = [ "@system-service" "~@privileged" "~@resouces" ];
UMask = "0077";
};
};

View file

@ -1,27 +1,16 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = {
services.beesd.filesystems = {
razmo = {
spec = "/mnt/razmo";
hashTableSizeMB = 512; # Recommended for 1 TiB, ×2 for compression, x2 for time
extraOptions = [
"--loadavg-target"
"7.5"
];
extraOptions = [ "--loadavg-target" "7.5" ];
};
rapido = {
spec = "/mnt/rapido";
hashTableSizeMB = 128; # 4 times smaller disk, 4 times smaller hashtable?
extraOptions = [
"--loadavg-target"
"5"
];
extraOptions = [ "--loadavg-target" "5" ];
};
};
};

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = {
frogeye.name = "curacao";

View file

@ -1,16 +1,10 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
let
desk_mqtt = pkgs.writers.writePython3 "desk_mqtt" {
libraries = with pkgs.python3Packages; [
pyusb
ha-mqtt-discoverable
];
} (builtins.readFile ./desk_mqtt.py);
desk_mqtt = pkgs.writers.writePython3 "desk_mqtt"
{
libraries = with pkgs.python3Packages; [ pyusb ha-mqtt-discoverable ];
}
(builtins.readFile ./desk_mqtt.py);
usb2lin06_udev = pkgs.writeTextFile {
name = "usb2lin06-udev-rules";
text = ''
@ -50,11 +44,7 @@ in
RestrictRealtime = true;
RestrictSUIDSGID = true;
SystemCallArchitectures = "native";
SystemCallFilter = [
"@system-service"
"~@privileged"
"~@resouces"
];
SystemCallFilter = [ "@system-service" "~@privileged" "~@resouces" ];
UMask = "0077";
};
};

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
# TODO Find a way to use keys in filesystem
# TODO Not relatime everywhere, thank you
# TODO Default options
@ -67,17 +62,11 @@ in
subvolumes = {
"home.razmo" = {
mountpoint = "/home.heavy";
mountOptions = [
"compress=zstd"
"relatime"
];
mountOptions = [ "compress=zstd" "relatime" ];
};
"steam" = {
mountpoint = "/opt/steam.razmo";
mountOptions = [
"compress=zstd"
"noatime"
];
mountOptions = [ "compress=zstd" "noatime" ];
};
};
};
@ -156,10 +145,7 @@ in
};
services.btrfs.autoScrub = {
enable = true;
fileSystems = [
"/mnt/razmo"
"/mnt/rapido"
];
fileSystems = [ "/mnt/razmo" "/mnt/rapido" ];
# TODO Should be generable from disko config, right?
};
}

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
nixos-hardware,
...
}:
{ pkgs, lib, nixos-hardware, unixpkgs, ... }:
let
displays = {
embedded = {
@ -24,14 +19,7 @@ in
config = {
boot = {
# From nixos-generate-config
initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"sd_mod"
"rtsx_usb_sdmmc"
];
initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" "rtsx_usb_sdmmc" ];
kernelModules = [ "kvm-intel" ];
# UEFI works here, and variables can be touched
@ -75,6 +63,14 @@ in
# TODO Display 2 doesn't work anymore?
};
};
nixpkgs.overlays = [
(self: super: {
displaylink = (import unixpkgs {
inherit (super) system;
config.allowUnfree = true;
}).displaylink;
})
];
services = {
autorandr = {
profiles = {
@ -107,10 +103,7 @@ in
};
};
# Needs prefetched binary blobs, see https://nixos.wiki/wiki/Displaylink
xserver.videoDrivers = [
"displaylink"
"modesetting"
];
xserver.videoDrivers = [ "displaylink" "modesetting" ];
# TODO See if nvidia and DL can work together.
};
};

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = {
networking = {

View file

@ -1,14 +1,8 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = {
boot.loader.efi.canTouchEfiVariables = false;
disko.devices.disk."${config.frogeye.name
}".device = "/dev/disk/by-id/usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0";
disko.devices.disk."${config.frogeye.name}".device = "/dev/disk/by-id/usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0";
frogeye.name = "curacao-usb";
};
imports = [

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = {
# TODO This should install cameractrls, but it seems like it's not easy to install.

View file

@ -5,11 +5,11 @@
"fromYaml": "fromYaml"
},
"locked": {
"lastModified": 1732200724,
"narHash": "sha256-+R1BH5wHhfnycySb7Sy5KbYEaTJZWm1h+LW1OtyhiTs=",
"lastModified": 1708890466,
"narHash": "sha256-LlrC09LoPi8OPYOGPXegD72v+//VapgAqhbOFS3i8sc=",
"owner": "SenchoPens",
"repo": "base16.nix",
"rev": "153d52373b0fb2d343592871009a286ec8837aec",
"rev": "665b3c6748534eb766c777298721cece9453fdae",
"type": "github"
},
"original": {
@ -34,14 +34,30 @@
"type": "github"
}
},
"base16-foot": {
"flake": false,
"locked": {
"lastModified": 1696725948,
"narHash": "sha256-65bz2bUL/yzZ1c8/GQASnoiGwaF8DczlxJtzik1c0AU=",
"owner": "tinted-theming",
"repo": "base16-foot",
"rev": "eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-foot",
"type": "github"
}
},
"base16-helix": {
"flake": false,
"locked": {
"lastModified": 1725860795,
"narHash": "sha256-Z2o8VBPW3I+KKTSfe25kskz0EUj7MpUh8u355Z1nVsU=",
"lastModified": 1696727917,
"narHash": "sha256-FVrbPk+NtMra0jtlC5oxyNchbm8FosmvXIatkRbYy1g=",
"owner": "tinted-theming",
"repo": "base16-helix",
"rev": "7f795bf75d38e0eea9fed287264067ca187b88a9",
"rev": "dbe1480d99fe80f08df7970e471fac24c05f2ddb",
"type": "github"
},
"original": {
@ -50,18 +66,50 @@
"type": "github"
}
},
"base16-vim": {
"base16-kitty": {
"flake": false,
"locked": {
"lastModified": 1731949548,
"narHash": "sha256-XIDexXM66sSh5j/x70e054BnUsviibUShW7XhbDGhYo=",
"lastModified": 1665001328,
"narHash": "sha256-aRaizTYPpuWEcvoYE9U+YRX+Wsc8+iG0guQJbvxEdJY=",
"owner": "kdrag0n",
"repo": "base16-kitty",
"rev": "06bb401fa9a0ffb84365905ffbb959ae5bf40805",
"type": "github"
},
"original": {
"owner": "kdrag0n",
"repo": "base16-kitty",
"type": "github"
}
},
"base16-tmux": {
"flake": false,
"locked": {
"lastModified": 1696725902,
"narHash": "sha256-wDPg5elZPcQpu7Df0lI5O8Jv4A3T6jUQIVg63KDU+3Q=",
"owner": "tinted-theming",
"repo": "base16-vim",
"rev": "61165b1632409bd55e530f3dbdd4477f011cadc6",
"repo": "base16-tmux",
"rev": "c02050bebb60dbb20cb433cd4d8ce668ecc11ba7",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-tmux",
"type": "github"
}
},
"base16-vim": {
"flake": false,
"locked": {
"lastModified": 1663659192,
"narHash": "sha256-uJvaYYDMXvoo0fhBZUhN8WBXeJ87SRgof6GEK2efFT0=",
"owner": "chriskempson",
"repo": "base16-vim",
"rev": "3be3cd82cd31acfcab9a41bad853d9c68d30478d",
"type": "github"
},
"original": {
"owner": "chriskempson",
"repo": "base16-vim",
"type": "github"
}
@ -94,11 +142,11 @@
]
},
"locked": {
"lastModified": 1735048446,
"narHash": "sha256-Tc35Y8H+krA6rZeOIczsaGAtobSSBPqR32AfNTeHDRc=",
"lastModified": 1730190761,
"narHash": "sha256-o5m5WzvY6cGIDupuOvjgNSS8AN6yP2iI9MtUC6q/uos=",
"owner": "nix-community",
"repo": "disko",
"rev": "3a4de9fa3a78ba7b7170dda6bd8b4cdab87c0b21",
"rev": "3979285062d6781525cded0f6c4ff92e71376b55",
"type": "github"
},
"original": {
@ -136,6 +184,22 @@
"type": "github"
}
},
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
@ -144,32 +208,11 @@
]
},
"locked": {
"lastModified": 1733312601,
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
"lastModified": 1727826117,
"narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"nur",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733312601,
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
"rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1",
"type": "github"
},
"original": {
@ -183,50 +226,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_3": {
"inputs": {
"systems": [
"stylix",
"systems"
]
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
@ -238,11 +242,11 @@
"fromYaml": {
"flake": false,
"locked": {
"lastModified": 1731966426,
"narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=",
"lastModified": 1689549921,
"narHash": "sha256-iX0pk/uB019TdBGlaJEWvBCfydT6sRq+eDcGPifVsCM=",
"owner": "SenchoPens",
"repo": "fromYaml",
"rev": "106af9e2f715e2d828df706c386a685698f3223b",
"rev": "11fbbbfb32e3289d3c631e0134a23854e7865c84",
"type": "github"
},
"original": {
@ -253,10 +257,7 @@
},
"git-hooks": {
"inputs": {
"flake-compat": [
"nixvim",
"flake-compat"
],
"flake-compat": "flake-compat_2",
"gitignore": "gitignore",
"nixpkgs": [
"nixvim",
@ -268,11 +269,11 @@
]
},
"locked": {
"lastModified": 1734425854,
"narHash": "sha256-nzE5UbJ41aPEKf8R2ZFYtLkqPmF7EIUbNEdHMBLg0Ig=",
"lastModified": 1729104314,
"narHash": "sha256-pZRZsq5oCdJt3upZIU4aslS9XwFJ+/nVtALHIciX/BI=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "0ddd26d0925f618c3a5d85a4fa5eb1e23a09491d",
"rev": "3c3e88f0f544d6bb54329832616af7eb971b6be6",
"type": "github"
},
"original": {
@ -306,16 +307,16 @@
"gnome-shell": {
"flake": false,
"locked": {
"lastModified": 1732369855,
"narHash": "sha256-JhUWbcYPjHO3Xs3x9/Z9RuqXbcp5yhPluGjwsdE2GMg=",
"lastModified": 1713702291,
"narHash": "sha256-zYP1ehjtcV8fo+c+JFfkAqktZ384Y+y779fzmR9lQAU=",
"owner": "GNOME",
"repo": "gnome-shell",
"rev": "dadd58f630eeea41d645ee225a63f719390829dc",
"rev": "0d0aadf013f78a7f7f1dc984d0d812971864b934",
"type": "github"
},
"original": {
"owner": "GNOME",
"ref": "47.2",
"ref": "46.1",
"repo": "gnome-shell",
"type": "github"
}
@ -327,16 +328,16 @@
]
},
"locked": {
"lastModified": 1734366194,
"narHash": "sha256-vykpJ1xsdkv0j8WOVXrRFHUAdp9NXHpxdnn1F4pYgSw=",
"lastModified": 1726989464,
"narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "80b0fdf483c5d1cb75aaad909bd390d48673857f",
"rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176",
"type": "github"
},
"original": {
"id": "home-manager",
"ref": "release-24.11",
"ref": "release-24.05",
"type": "indirect"
}
},
@ -348,16 +349,16 @@
]
},
"locked": {
"lastModified": 1734366194,
"narHash": "sha256-vykpJ1xsdkv0j8WOVXrRFHUAdp9NXHpxdnn1F4pYgSw=",
"lastModified": 1726989464,
"narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "80b0fdf483c5d1cb75aaad909bd390d48673857f",
"rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-24.11",
"ref": "release-24.05",
"repo": "home-manager",
"type": "github"
}
@ -370,80 +371,19 @@
]
},
"locked": {
"lastModified": 1733572789,
"narHash": "sha256-zjO6m5BqxXIyjrnUziAzk4+T4VleqjstNudSqWcpsHI=",
"lastModified": 1714981474,
"narHash": "sha256-b3/U21CJjCjJKmA9WqUbZGZgCvospO3ArOUTgJugkOY=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "c7ffc9727d115e433fd884a62dc164b587ff651d",
"rev": "6ebe7be2e67be7b9b54d61ce5704f6fb466c536f",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-24.11",
"repo": "home-manager",
"type": "github"
}
},
"ixx": {
"inputs": {
"flake-utils": [
"nixvim",
"nuschtosSearch",
"flake-utils"
],
"nixpkgs": [
"nixvim",
"nuschtosSearch",
"nixpkgs"
]
},
"locked": {
"lastModified": 1729958008,
"narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=",
"owner": "NuschtOS",
"repo": "ixx",
"rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"ref": "v0.0.6",
"repo": "ixx",
"type": "github"
}
},
"jjuinixpkgs": {
"locked": {
"lastModified": 1734688116,
"narHash": "sha256-Ex3o8880p+yZ9915s46/4XtnN4jS6tqp2TlfGR1+l1w=",
"owner": "Adda0",
"repo": "nixpkgs",
"rev": "c951613d3cb3d61b14c890238017d0685ff359f9",
"type": "github"
},
"original": {
"owner": "Adda0",
"ref": "jjui",
"repo": "nixpkgs",
"type": "github"
}
},
"labellenixpkgs": {
"locked": {
"lastModified": 1733305049,
"narHash": "sha256-j3L36nA0PTjVA6gtMVILBhrBSMxuhevlDW9Nfws1oII=",
"owner": "FabianRig",
"repo": "nixpkgs",
"rev": "88ac05665bc6a85aabe78070b99fd23ad1675409",
"type": "github"
},
"original": {
"owner": "FabianRig",
"ref": "update-labelle-1.3.2",
"repo": "nixpkgs",
"type": "github"
}
},
"nix-darwin": {
"inputs": {
"nixpkgs": [
@ -452,11 +392,11 @@
]
},
"locked": {
"lastModified": 1733570843,
"narHash": "sha256-sQJAxY1TYWD1UyibN/FnN97paTFuwBw3Vp3DNCyKsMk=",
"lastModified": 1729826725,
"narHash": "sha256-w3WNlYxqWYsuzm/jgFPyhncduoDNjot28aC8j39TW0U=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "a35b08d09efda83625bef267eb24347b446c80b8",
"rev": "7840909b00fbd5a183008a6eb251ea307fe4a76e",
"type": "github"
},
"original": {
@ -520,11 +460,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1734954597,
"narHash": "sha256-QIhd8/0x30gEv8XEE1iAnrdMlKuQ0EzthfDR7Hwl+fk=",
"lastModified": 1730161780,
"narHash": "sha256-z5ILcmwMtiCoHTXS1KsQWqigO7HJO8sbyK7f7wn9F/E=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "def1d472c832d77885f174089b0d34854b007198",
"rev": "07d15e8990d5d86a631641b4c429bc0a7400cfb8",
"type": "github"
},
"original": {
@ -534,16 +474,16 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1734991663,
"narHash": "sha256-8T660guvdaOD+2/Cj970bWlQwAyZLKrrbkhYOFcY1YE=",
"lastModified": 1730137625,
"narHash": "sha256-9z8oOgFZiaguj+bbi3k4QhAD6JabWrnv7fscC/mt0KE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6c90912761c43e22b6fb000025ab96dd31c971ff",
"rev": "64b80bfb316b57cdb8919a9110ef63393d74382a",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-24.11",
"ref": "nixos-24.05",
"type": "indirect"
}
},
@ -579,22 +519,6 @@
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1734649271,
"narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixvim": {
"inputs": {
"devshell": "devshell",
@ -606,20 +530,19 @@
"nixpkgs": [
"nixpkgs"
],
"nuschtosSearch": "nuschtosSearch",
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1734784342,
"narHash": "sha256-uap4LcvjpTz5WTgDfQYtL3QCpGmtee7DuD5mB8AIiLw=",
"lastModified": 1729945968,
"narHash": "sha256-4u+nbBSMuXWGCtXxUPPEflRm54+y/HLIbhIep9do8Ew=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "334947672f1eb05488e69657b9c412230bd658b4",
"rev": "c05ac01070425ed0797b1ff678dc690c333cea74",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "nixos-24.11",
"ref": "nixos-24.05",
"repo": "nixvim",
"type": "github"
}
@ -663,17 +586,12 @@
}
},
"nur": {
"inputs": {
"flake-parts": "flake-parts_2",
"nixpkgs": "nixpkgs_2",
"treefmt-nix": "treefmt-nix_2"
},
"locked": {
"lastModified": 1735130532,
"narHash": "sha256-efntkb+ydFSI2kvLn6SURQEp4KnThRGZ2eeJHiKL93o=",
"lastModified": 1730300129,
"narHash": "sha256-QZm3ZsHn/75VsGg7ScPGfdByqBPFIQHmbpjT37iQp2g=",
"owner": "nix-community",
"repo": "NUR",
"rev": "b9f4b07220fa430240dba1825cdac9d673dedf55",
"rev": "656dcf946af3e368dd872fe525439518d8423080",
"type": "github"
},
"original": {
@ -682,42 +600,18 @@
"type": "github"
}
},
"nuschtosSearch": {
"inputs": {
"flake-utils": "flake-utils_2",
"ixx": "ixx",
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733773348,
"narHash": "sha256-Y47y+LesOCkJaLvj+dI/Oa6FAKj/T9sKVKDXLNsViPw=",
"owner": "NuschtOS",
"repo": "search",
"rev": "3051be7f403bff1d1d380e4612f0c70675b44fc9",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"repo": "search",
"type": "github"
}
},
"root": {
"inputs": {
"disko": "disko",
"flake-utils": "flake-utils",
"home-manager": "home-manager",
"jjuinixpkgs": "jjuinixpkgs",
"labellenixpkgs": "labellenixpkgs",
"nix-on-droid": "nix-on-droid",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
"nixvim": "nixvim",
"nur": "nur",
"stylix": "stylix"
"stylix": "stylix",
"unixpkgs": "unixpkgs"
}
},
"scss-reset": {
@ -740,31 +634,29 @@
"inputs": {
"base16": "base16",
"base16-fish": "base16-fish",
"base16-foot": "base16-foot",
"base16-helix": "base16-helix",
"base16-kitty": "base16-kitty",
"base16-tmux": "base16-tmux",
"base16-vim": "base16-vim",
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_3",
"flake-compat": "flake-compat_3",
"gnome-shell": "gnome-shell",
"home-manager": "home-manager_3",
"nixpkgs": [
"nixpkgs"
],
"systems": "systems_3",
"tinted-foot": "tinted-foot",
"tinted-kitty": "tinted-kitty",
"tinted-tmux": "tinted-tmux"
]
},
"locked": {
"lastModified": 1734110444,
"narHash": "sha256-fp1iV2JldCSvz+7ODzXYUkQ+H7zyiWw5E0MQ4ILC4vw=",
"lastModified": 1718122552,
"narHash": "sha256-A+dBkSwp8ssHKV/WyXb9uqIYrHBqHvtSedU24Lq9lqw=",
"owner": "danth",
"repo": "stylix",
"rev": "9015d5d0d5d100f849129c43d257b827d300b089",
"rev": "e59d2c1725b237c362e4a62f5722f5b268d566c7",
"type": "github"
},
"original": {
"owner": "danth",
"ref": "release-24.11",
"ref": "release-24.05",
"repo": "stylix",
"type": "github"
}
@ -784,86 +676,6 @@
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"tinted-foot": {
"flake": false,
"locked": {
"lastModified": 1726913040,
"narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=",
"owner": "tinted-theming",
"repo": "tinted-foot",
"rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "tinted-foot",
"rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4",
"type": "github"
}
},
"tinted-kitty": {
"flake": false,
"locked": {
"lastModified": 1716423189,
"narHash": "sha256-2xF3sH7UIwegn+2gKzMpFi3pk5DlIlM18+vj17Uf82U=",
"owner": "tinted-theming",
"repo": "tinted-kitty",
"rev": "eb39e141db14baef052893285df9f266df041ff8",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "tinted-kitty",
"rev": "eb39e141db14baef052893285df9f266df041ff8",
"type": "github"
}
},
"tinted-tmux": {
"flake": false,
"locked": {
"lastModified": 1729501581,
"narHash": "sha256-1ohEFMC23elnl39kxWnjzH1l2DFWWx4DhFNNYDTYt54=",
"owner": "tinted-theming",
"repo": "tinted-tmux",
"rev": "f0e7f7974a6441033eb0a172a0342e96722b4f14",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "tinted-tmux",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
@ -872,11 +684,11 @@
]
},
"locked": {
"lastModified": 1734704479,
"narHash": "sha256-MMi74+WckoyEWBRcg/oaGRvXC9BVVxDZNRMpL+72wBI=",
"lastModified": 1729613947,
"narHash": "sha256-XGOvuIPW1XRfPgHtGYXd5MAmJzZtOuwlfKDgxX5KT3s=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "65712f5af67234dad91a5a4baee986a8b62dbf8f",
"rev": "aac86347fb5063960eccb19493e0cadcdb4205ca",
"type": "github"
},
"original": {
@ -885,25 +697,19 @@
"type": "github"
}
},
"treefmt-nix_2": {
"inputs": {
"nixpkgs": [
"nur",
"nixpkgs"
]
},
"unixpkgs": {
"locked": {
"lastModified": 1733222881,
"narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "49717b5af6f80172275d47a418c9719a31a78b53",
"lastModified": 1730298926,
"narHash": "sha256-ao1BYrrOB8SGdvOul6hGJYqp/QqEJTwZRViRXFvNnTQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "838f2f70e0e44d957009bf5a4fc0aa9c931b680e",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
"id": "nixpkgs",
"ref": "master",
"type": "indirect"
}
}
},

189
flake.nix
View file

@ -3,9 +3,8 @@
inputs = {
# Packages
nixpkgs.url = "nixpkgs/nixos-24.11";
jjuinixpkgs.url = "github:Adda0/nixpkgs/jjui"; # Testing PR
labellenixpkgs.url = "github:FabianRig/nixpkgs/update-labelle-1.3.2"; # Current 24.11 version doesn't match dependencies
nixpkgs.url = "nixpkgs/nixos-24.05";
unixpkgs.url = "nixpkgs/master";
# OS
disko = {
url = "disko";
@ -14,21 +13,21 @@
nixos-hardware.url = "nixos-hardware";
# NOD
nix-on-droid = {
url = "github:nix-community/nix-on-droid"; # No 24.11 yet
url = "github:nix-community/nix-on-droid"; # No 24.05 yet
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
# HM
home-manager = {
url = "home-manager/release-24.11";
url = "home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
stylix = {
url = "github:danth/stylix/release-24.11";
url = "github:danth/stylix/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = "github:nix-community/nixvim/nixos-24.11";
url = "github:nix-community/nixvim/nixos-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
nur.url = "github:nix-community/NUR";
@ -36,26 +35,15 @@
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
disko,
nix-on-droid,
flake-utils,
nur,
...
}@attrs:
outputs = { self, nixpkgs, disko, nix-on-droid, flake-utils, ... }@attrs:
# Machine independant outputs
let
nixpkgsConfig = {
config = {
allowUnfree = true;
# TODO Handpick exceptions
};
overlays = [
(import ./common/update-local-flakes/overlay.nix)
nur.overlays.default
];
};
homeManagerConfig = {
@ -63,105 +51,71 @@
extraSpecialArgs = attrs;
};
lib = {
nixosSystem =
{
system,
modules ? [ ],
}:
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = attrs;
modules = modules ++ [
self.nixosModules.dotfiles
# nur.modules.nixos.default
{
nixpkgs = nixpkgsConfig;
home-manager = homeManagerConfig;
frogeye.toplevel = {
_type = "override";
content = self;
priority = 1000;
};
}
];
};
nixOnDroidConfiguration =
{
modules ? [ ],
}:
nix-on-droid.lib.nixOnDroidConfiguration {
pkgs = import nixpkgs (
nixpkgsConfig
// {
system = "aarch64-linux"; # nod doesn't support anything else
}
);
modules = modules ++ [
self.nixOnDroidModules.dotfiles
{
home-manager = homeManagerConfig;
}
];
};
flakeTools =
{ self }:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs (
nixpkgsConfig
// {
inherit system;
# We do an overlay here so nixos-rebuild and other use lix.
# We don't do an overlay for the whole system because lix is not binary compatible.
overlays = [
(self: super: { nix = super.lix; })
];
}
);
in
nixosSystem = { system, modules ? [ ] }: nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = attrs;
modules = modules ++ [
self.nixosModules.dotfiles
{
apps = {
disko = {
type = "app";
program = "${disko.packages.${system}.default}/bin/disko";
};
nixos-install = {
type = "app";
program = "${pkgs.nixos-install-tools}/bin/nixos-install";
};
nixos-rebuild = {
type = "app";
program = "${pkgs.nixos-rebuild}/bin/nixos-rebuild";
};
repl = {
type = "app";
program = "${pkgs.writeShellScript "vivarium-repl" ''
${pkgs.lix}/bin/nix repl --expr 'let flake = builtins.getFlake "${self}"; in flake // flake.nixosConfigurations // rec { pkgs = import ${nixpkgs} {}; lib = pkgs.lib; }'
''}";
};
# Available globally should this be needed in times of shenanigans
updateLocalFlakes = {
type = "app";
program = "${pkgs.update-local-flakes}/bin/update-local-flakes";
};
nixosRebuild = {
type = "app";
program = "${pkgs.writeShellScript "rebuild" ''${
pkgs.writeShellApplication {
name = "rebuild";
runtimeInputs = with pkgs; [
nix-output-monitor
nixos-rebuild
];
text = builtins.readFile ./os/rebuild.sh;
}
}/bin/rebuild ${self} "$@"''}";
};
};
formatter = pkgs.nixfmt-rfc-style;
nixpkgs = nixpkgsConfig;
home-manager = homeManagerConfig;
frogeye.toplevel = { _type = "override"; content = self; priority = 1000; };
}
);
];
};
nixOnDroidConfiguration = { modules ? [ ] }: nix-on-droid.lib.nixOnDroidConfiguration {
pkgs = import nixpkgs (nixpkgsConfig // {
system = "aarch64-linux"; # nod doesn't support anything else
});
modules = modules ++ [
self.nixOnDroidModules.dotfiles
{
home-manager = homeManagerConfig;
}
];
};
flakeTools = { self }: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs (nixpkgsConfig // {
inherit system;
});
in
{
apps = {
disko = {
type = "app";
program = "${disko.packages.${system}.default}/bin/disko";
};
nixos-install = {
type = "app";
program = "${pkgs.nixos-install-tools}/bin/nixos-install";
};
nixos-rebuild = {
type = "app";
program = "${pkgs.nixos-rebuild}/bin/nixos-rebuild";
};
repl = {
type = "app";
program = "${pkgs.writeShellScript "vivarium-repl" ''
${pkgs.lix}/bin/nix repl --expr 'let flake = builtins.getFlake "${self}"; in flake // flake.nixosConfigurations // rec { pkgs = import ${nixpkgs} {}; lib = pkgs.lib; }'
''}";
};
# Available globally should this be needed in times of shenanigans
updateLocalFlakes = {
type = "app";
program = "${pkgs.update-local-flakes}/bin/update-local-flakes";
};
nixosRebuild = {
type = "app";
program = "${pkgs.writeShellScript "rebuild" ''${pkgs.writeShellApplication {
name = "rebuild";
runtimeInputs = with pkgs; [ nix-output-monitor nixos-rebuild ];
text = builtins.readFile ./os/rebuild.sh;
}}/bin/rebuild ${self} "$@"''}";
};
};
}
);
};
in
{
@ -202,6 +156,5 @@
modules = [ ./sprinkles/standin.nix ];
};
# TODO devices/ or configs/ folders
}
// (lib.flakeTools { inherit self; });
} // (lib.flakeTools { inherit self; });
}

View file

@ -1,25 +1,15 @@
{
pkgs,
config,
lib,
...
}:
{ pkgs, config, lib, ... }:
let
mkUserJs =
with lib;
prefs: extraPrefs: ''
// Generated by Geoffrey's dotfiles.
mkUserJs = with lib; prefs: extraPrefs: ''
// Generated by Geoffrey's dotfiles.
${concatStrings (
mapAttrsToList (name: value: ''
user_pref("${name}", ${builtins.toJSON value});
'') prefs
)}
${extraPrefs}
'';
${concatStrings (mapAttrsToList (name: value: ''
user_pref("${name}", ${builtins.toJSON value});
'') prefs)}
${extraPrefs}
'';
toThunderbirdCalendar =
account:
toThunderbirdCalendar = account:
let
id = builtins.hashString "sha256" account.name;
thunderbird = config.frogeye.accounts.calendar.accounts.${account.name};
@ -53,29 +43,25 @@ in
profiles.hm = {
isDefault = true;
withExternalGnupg = true;
extraConfig = mkUserJs (lib.attrsets.mergeAttrsList (
# Add calendar config
(lib.mapAttrsToList (
name: account: (toThunderbirdCalendar account)
) config.accounts.calendar.accounts)
++
extraConfig = mkUserJs
(lib.attrsets.mergeAttrsList (
# Add calendar config
(lib.mapAttrsToList (name: account: (toThunderbirdCalendar account)) config.accounts.calendar.accounts) ++
# Add config for every identity (kinda)
(lib.mapAttrsToList (name: account: ({
# UPST Make signature be used in Thunderbird
"mail.identity.id_${builtins.hashString "sha256" account.address}.htmlSigText" =
account.signature.text;
"mail.identity.id_${builtins.hashString "sha256" account.address}.compose_html" = false;
})) config.accounts.email.accounts)
++
(lib.mapAttrsToList
(name: account: ({
# UPST Make signature be used in Thunderbird
"mail.identity.id_${builtins.hashString "sha256" account.address}.htmlSigText" = account.signature.text;
"mail.identity.id_${builtins.hashString "sha256" account.address}.compose_html" = false;
}))
config.accounts.email.accounts) ++
# General settings
[
{
"mail.pane_config.dynamic" = 0;
"intl.date_time.pattern_override.date_short" = "yyyy-MM-dd";
}
]
[{
"mail.pane_config.dynamic" = 0;
"intl.date_time.pattern_override.date_short" = "yyyy-MM-dd";
}]
)) "";
)) "";
};
};
};
@ -83,45 +69,40 @@ in
options = {
frogeye.accounts.calendar.accounts = lib.mkOption {
default = { };
type = lib.types.attrsOf (
lib.types.submodule (
{ config, name, ... }:
{
# TODO Set defaults as Thunderbird sets it
options = {
color = lib.mkOption {
type = lib.types.str;
default = "#5277c3";
};
refreshInterval = lib.mkOption {
type = lib.types.int;
default = 0; # 0 = Manual
};
readOnly = lib.mkOption {
type = lib.types.bool;
default = false;
};
showReminders = lib.mkOption {
type = lib.types.bool;
default = true;
};
offlineSupport = lib.mkOption {
type = lib.types.bool;
default = true;
};
email = lib.mkOption {
type = lib.types.str;
# TODO Nullable
# TODO Ensure it actually matches an email identity
};
clientSideEmailScheduling = lib.mkOption {
type = lib.types.bool;
default = false;
};
};
}
)
);
type = lib.types.attrsOf (lib.types.submodule ({ config, name, ... }: {
# TODO Set defaults as Thunderbird sets it
options = {
color = lib.mkOption {
type = lib.types.str;
default = "#5277c3";
};
refreshInterval = lib.mkOption {
type = lib.types.int;
default = 0; # 0 = Manual
};
readOnly = lib.mkOption {
type = lib.types.bool;
default = false;
};
showReminders = lib.mkOption {
type = lib.types.bool;
default = true;
};
offlineSupport = lib.mkOption {
type = lib.types.bool;
default = true;
};
email = lib.mkOption {
type = lib.types.str;
# TODO Nullable
# TODO Ensure it actually matches an email identity
};
clientSideEmailScheduling = lib.mkOption {
type = lib.types.bool;
default = false;
};
};
}));
};
};
}

View file

@ -1,46 +1,27 @@
# Light theme during the day, dark theme during the night (not automatic)
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
let
phases = [
{
command = "jour";
specialisation = null;
}
{
command = "crepuscule";
specialisation = "dark";
}
{
command = "nuit";
specialisation = "dark";
}
{ command = "jour"; specialisation = null; }
{ command = "crepuscule"; specialisation = "dark"; }
{ command = "nuit"; specialisation = "dark"; }
];
mod = config.xsession.windowManager.i3.config.modifier;
in
{
config = {
home.packages =
(map (
phase:
(pkgs.writeShellScriptBin phase.command ''
switch="/nix/var/nix/profiles/system${
lib.strings.optionalString (phase.specialisation != null) "/specialisation/${phase.specialisation}"
}/bin/switch-to-configuration"
if [ -x "$switch" ]
then
sudo "$switch" test &
sudo "$switch" boot &
fi
${builtins.getAttr phase.command config.frogeye.desktop.phasesCommands}
wait
'')
) phases)
++ (with pkgs; [
home.packages = (map
(phase: (pkgs.writeShellScriptBin phase.command ''
switch="/nix/var/nix/profiles/system${lib.strings.optionalString (phase.specialisation != null) "/specialisation/${phase.specialisation}"}/bin/switch-to-configuration"
if [ -x "$switch" ]
then
sudo "$switch" test &
sudo "$switch" boot &
fi
${builtins.getAttr phase.command config.frogeye.desktop.phasesCommands}
wait
''))
phases) ++ (with pkgs; [
brightnessctl
]);
xsession.windowManager.i3.config.keybindings = {

View file

@ -1,13 +1,4 @@
{
pkgs,
config,
lib,
labellenixpkgs,
...
}:
let
labellepkgs = import labellenixpkgs { inherit (pkgs) system; };
in
{ pkgs, config, lib, ... }:
{
frogeye.hooks.lock = ''
${pkgs.coreutils}/bin/rm -rf "/tmp/cached_pass_$UID"
@ -47,6 +38,7 @@ in
la = "lsd -la";
s = "sudo -s -E";
# Preference
wol = "wakeonlan"; # TODO Really, isn't wol better? Also wtf Arch aliases to pass because neither is installed anyways x)
mutt = "neomutt";
@ -78,48 +70,13 @@ in
};
colors = {
# Base16 only, so it reuses the current theme.
date = {
day-old = 4;
hour-old = 6;
older = 5;
};
git-status = {
conflicted = 14;
default = 13;
deleted = 1;
ignored = 13;
modified = 3;
new-in-index = 2;
new-in-workdir = 2;
renamed = 4;
typechange = 3;
unmodified = 13;
};
date = { day-old = 4; hour-old = 6; older = 5; };
git-status = { conflicted = 14; default = 13; deleted = 1; ignored = 13; modified = 3; new-in-index = 2; new-in-workdir = 2; renamed = 4; typechange = 3; unmodified = 13; };
group = 6;
inode = {
invalid = 245;
valid = 13;
};
links = {
invalid = 9;
valid = 14;
};
permission = {
acl = 6;
context = 14;
exec = 1;
exec-sticky = 5;
no-access = 245;
octal = 6;
read = 2;
write = 3;
};
size = {
large = 1;
medium = 9;
none = 11;
small = 3;
};
inode = { invalid = 245; valid = 13; };
links = { invalid = 9; valid = 14; };
permission = { acl = 6; context = 14; exec = 1; exec-sticky = 5; no-access = 245; octal = 6; read = 2; write = 3; };
size = { large = 1; medium = 9; none = 11; small = 3; };
tree-edge = 13;
user = 2;
};
@ -135,13 +92,8 @@ in
fzf = {
enable = true;
enableZshIntegration = true;
defaultOptions = [
"--height 40%"
"--layout=default"
];
fileWidgetOptions = [
"--preview '[[ -d {} ]] && ${pkgs.coreutils}/bin/ls -l --color=always {} || [[ \$(${pkgs.file}/bin/file --mime {}) =~ binary ]] && ${pkgs.file}/bin/file --brief {} || (${pkgs.highlight}/bin/highlight -O ansi -l {} || coderay {} || rougify {} || ${pkgs.coreutils}/bin/cat {}) 2> /dev/null | head -500'"
];
defaultOptions = [ "--height 40%" "--layout=default" ];
fileWidgetOptions = [ "--preview '[[ -d {} ]] && ${pkgs.coreutils}/bin/ls -l --color=always {} || [[ \$(${pkgs.file}/bin/file --mime {}) =~ binary ]] && ${pkgs.file}/bin/file --brief {} || (${pkgs.highlight}/bin/highlight -O ansi -l {} || coderay {} || rougify {} || ${pkgs.coreutils}/bin/cat {}) 2> /dev/null | head -500'" ];
# TODO Above not working... not really used either?
# file and friends are not in PATH by default... so here we want aboslute paths, which means those won't get reloaded. Meh.
};
@ -239,7 +191,7 @@ in
usbutils
dmidecode
lshw
labellepkgs.labelle # Label printer
labelle # Label printer
# Locker
(pkgs.writeShellApplication {

View file

@ -8,7 +8,7 @@
./common.nix
./desktop
./dev
./extra
./extra.nix
./gaming
./git
./gpg

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
let
pactl = "exec ${pkgs.pulseaudio}/bin/pactl"; # TODO Use NixOS package if using NixOS
mod = config.xsession.windowManager.i3.config.modifier;
@ -32,13 +27,14 @@ in
text = ''cookie-file = .config/pulse/pulse-cookie'';
};
};
xsession.windowManager.i3.config.keybindings = {
"XF86AudioRaiseVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ +5%";
"XF86AudioLowerVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ -5%";
"XF86AudioMute" = "${pactl} set-sink-mute @DEFAULT_SINK@ true";
"${mod}+F8" = "${pactl} suspend-sink @DEFAULT_SINK@ 1; ${pactl} suspend-sink @DEFAULT_SINK@ 0"; # Re-synchronize bluetooth headset
"${mod}+F11" = "exec ${pkgs.pavucontrol}/bin/pwvucontrol";
# TODO Find pacmixer?
};
xsession.windowManager.i3.config.keybindings =
{
"XF86AudioRaiseVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ +5%";
"XF86AudioLowerVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ -5%";
"XF86AudioMute" = "${pactl} set-sink-mute @DEFAULT_SINK@ true";
"${mod}+F8" = "${pactl} suspend-sink @DEFAULT_SINK@ 1; ${pactl} suspend-sink @DEFAULT_SINK@ 0"; # Re-synchronize bluetooth headset
"${mod}+F11" = "exec ${pkgs.pavucontrol}/bin/pwvucontrol";
# TODO Find pacmixer?
};
};
}

View file

@ -1,30 +1,10 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
let
builtin_configs = [
"off"
"common"
"clone-largest"
"horizontal"
"vertical"
"horizontal-reverse"
"vertical-reverse"
];
autorandrmenu =
{
title,
option,
builtin ? false,
}:
pkgs.writeShellScript "autorandrmenu" ''
builtin_configs = [ "off" "common" "clone-largest" "horizontal" "vertical" "horizontal-reverse" "vertical-reverse" ];
autorandrmenu = { title, option, builtin ? false }: pkgs.writeShellScript "autorandrmenu"
''
shopt -s nullglob globstar
profiles="${
if builtin then lib.strings.concatLines builtin_configs else ""
}$(${pkgs.autorandr}/bin/autorandr | ${pkgs.gawk}/bin/awk '{ print $1 }')"
profiles="${if builtin then lib.strings.concatLines builtin_configs else ""}$(${pkgs.autorandr}/bin/autorandr | ${pkgs.gawk}/bin/awk '{ print $1 }')"
profile="$(echo "$profiles" | ${config.programs.rofi.package}/bin/rofi -dmenu -p "${title}")"
[[ -n "$profile" ]] || exit
${pkgs.autorandr}/bin/autorandr ${option} "$profile"
@ -33,38 +13,17 @@ in
{
config = lib.mkIf config.frogeye.desktop.xorg {
frogeye.desktop.i3.bindmodes = {
"Screen setup [A] Auto [L] Load [S] Save [R] Remove [D] Default" = {
bindings = {
"a" = "exec ${pkgs.autorandr}/bin/autorandr --change --force, mode default";
"l" = "exec ${
autorandrmenu {
title = "Load profile";
option = "--load";
builtin = true;
}
}, mode default";
"s" = "exec ${
autorandrmenu {
title = "Save profile";
option = "--save";
}
}, mode default";
"r" = "exec ${
autorandrmenu {
title = "Remove profile";
option = "--remove";
}
}, mode default";
"d" = "exec ${
autorandrmenu {
title = "Default profile";
option = "--default";
builtin = true;
}
}, mode default";
"Screen setup [A] Auto [L] Load [S] Save [R] Remove [D] Default" =
{
bindings = {
"a" = "exec ${pkgs.autorandr}/bin/autorandr --change --force, mode default";
"l" = "exec ${autorandrmenu {title="Load profile"; option="--load"; builtin = true;}}, mode default";
"s" = "exec ${autorandrmenu {title="Save profile"; option="--save";}}, mode default";
"r" = "exec ${autorandrmenu {title="Remove profile"; option="--remove";}}, mode default";
"d" = "exec ${autorandrmenu {title="Default profile"; option="--default"; builtin = true;}}, mode default";
};
mod_enter = "t";
};
mod_enter = "t";
};
};
programs.autorandr.enable = true;
services.autorandr.enable = true;

View file

@ -1,9 +1,4 @@
{
pkgs,
config,
lib,
...
}:
{ pkgs, config, lib, ... }:
{
config = {
# This correctly sets the background on some occasions, below does the rest

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, nur, ... }:
{
config = lib.mkIf config.frogeye.desktop.xorg {
home.sessionVariables = {
@ -19,25 +14,27 @@
};
profiles.hm = {
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
(buildFirefoxXpiAddon {
extensions = with config.nur.repos.rycee.firefox-addons;
[
(buildFirefoxXpiAddon {
pname = "onetab";
version = "0.1.0";
addonId = "onetab@nated";
url = "https://addons.mozilla.org/firefox/downloads/file/4118712/one_tab_per_window-0.1.0.xpi";
sha256 = "sha256-64DeL2xgXpqz32LJWDx4jhS2Fvbld8re3z8fdwnNTw0=";
meta = with lib; {
homepage = "https://git.sr.ht/~nated/onetab";
description = "When a new tab is opened, redirects it to a new window instead.";
license = licenses.unfree;
mozPermissions = [ "tabs" ];
platforms = platforms.all;
};
})
tridactyl
ublock-origin
];
pname = "onetab";
version = "0.1.0";
addonId = "onetab@nated";
url = "https://addons.mozilla.org/firefox/downloads/file/4118712/one_tab_per_window-0.1.0.xpi";
sha256 = "sha256-64DeL2xgXpqz32LJWDx4jhS2Fvbld8re3z8fdwnNTw0=";
meta = with lib;
{
homepage = "https://git.sr.ht/~nated/onetab";
description = "When a new tab is opened, redirects it to a new window instead.";
license = licenses.unfree;
mozPermissions = [ "tabs" ];
platforms = platforms.all;
};
})
tridactyl
ublock-origin
];
search = {
default = "DuckDuckGo";
engines = {
@ -47,14 +44,8 @@
{
template = "https://search.nixos.org/packages";
params = [
{
name = "type";
value = "packages";
}
{
name = "query";
value = "{searchTerms}";
}
{ name = "type"; value = "packages"; }
{ name = "query"; value = "{searchTerms}"; }
];
}
];
@ -62,7 +53,7 @@
definedAliases = [ "@np" ];
};
"NixOS Wiki" = {
urls = [ { template = "https://nixos.wiki/index.php?search={searchTerms}"; } ];
urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }];
iconUpdateURL = "https://nixos.wiki/favicon.png";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = [ "@nw" ];
@ -160,14 +151,7 @@
tls.certificate_errors = "ask-block-thirdparty";
javascript.clipboard = "access"; # copy-paste is fine
};
editor.command = [
"${pkgs.neovide}/bin/neovide"
"--"
"-f"
"{file}"
"-c"
"normal {line}G{column0}l"
];
editor.command = [ "${pkgs.neovide}/bin/neovide" "--" "-f" "{file}" "-c" "normal {line}G{column0}l" ];
# TODO Doesn't work on Arch. Does it even load the right profile on Nix?
# TODO spellcheck.languages = ["fr-FR" "en-GB" "en-US"];
};
@ -190,4 +174,7 @@
"${config.xsession.windowManager.i3.config.modifier}+m" = "exec ${config.programs.qutebrowser.package}/bin/qutebrowser --override-restore";
};
};
imports = [
nur.hmModules.nur
];
}

View file

@ -1,9 +1,4 @@
{
pkgs,
config,
lib,
...
}:
{ pkgs, config, lib, ... }:
{
imports = [
./audio
@ -57,10 +52,7 @@
hwdec = "auto-safe";
profile = "gpu-hq";
};
scripts = with pkgs.mpvScripts; [
thumbnail
mpris
];
scripts = with pkgs.mpvScripts; [ thumbnail mpris ];
scriptOpts = {
mpv_thumbnail_script = {
autogenerate = false; # TODO It creates too many processes at once, crashing the system
@ -74,86 +66,68 @@
xdg = {
userDirs =
let
wellKnownUserDirs = [
"desktop"
"documents"
"download"
"music"
"pictures"
"publicShare"
"templates"
"videos"
];
wellKnownUserDirsNulled = builtins.listToAttrs (
builtins.map (name: {
inherit name;
value = null;
}) wellKnownUserDirs
);
wellKnownUserDirs = [ "desktop" "documents" "download" "music" "pictures" "publicShare" "templates" "videos" ];
wellKnownUserDirsNulled = builtins.listToAttrs (builtins.map (name: { inherit name; value = null; }) wellKnownUserDirs);
allFolders = builtins.attrValues config.frogeye.folders;
folders = builtins.filter (
folder: folder.xdgUserDirVariable != null && folder.user == config.home.username
) allFolders;
folders = builtins.filter (folder: folder.xdgUserDirVariable != null && folder.user == config.home.username) allFolders;
in
{
enable = true;
createDirectories = true;
extraConfig = builtins.listToAttrs (
builtins.map (folder: {
extraConfig = builtins.listToAttrs (builtins.map
(folder: {
name = folder.xdgUserDirVariable;
value = "${config.home.homeDirectory}/${folder.path}";
}) folders
);
}
// wellKnownUserDirsNulled; # Don't use defaults dirs
})
folders);
} // wellKnownUserDirsNulled; # Don't use defaults dirs
};
services = {
blueman-applet.enable = true;
unclutter.enable = true;
dunst = {
enable = true;
settings =
# TODO Change dmenu for rofi, so we can use context
with config.lib.stylix.colors.withHashtag; {
global = {
separator_color = lib.mkForce base05;
idle_threshold = 120;
markup = "full";
max_icon_size = 48;
# TODO Those shortcuts don't seem to work, maybe try:
# > define shortcuts inside your window manager and bind them to dunstctl(1) commands
close_all = "ctrl+mod4+n";
close = "mod4+n";
context = "mod1+mod4+n";
history = "shift+mod4+n";
};
dunst =
{
enable = true;
settings =
# TODO Change dmenu for rofi, so we can use context
with config.lib.stylix.colors.withHashtag; {
global = {
separator_color = lib.mkForce base05;
idle_threshold = 120;
markup = "full";
max_icon_size = 48;
# TODO Those shortcuts don't seem to work, maybe try:
# > define shortcuts inside your window manager and bind them to dunstctl(1) commands
close_all = "ctrl+mod4+n";
close = "mod4+n";
context = "mod1+mod4+n";
history = "shift+mod4+n";
};
urgency_low = {
background = lib.mkForce base01;
foreground = lib.mkForce base03;
frame_color = lib.mkForce base05;
urgency_low = {
background = lib.mkForce base01;
foreground = lib.mkForce base03;
frame_color = lib.mkForce base05;
};
urgency_normal = {
background = lib.mkForce base02;
foreground = lib.mkForce base05;
frame_color = lib.mkForce base05;
};
urgency_critical = {
background = lib.mkForce base08;
foreground = lib.mkForce base06;
frame_color = lib.mkForce base05;
};
};
urgency_normal = {
background = lib.mkForce base02;
foreground = lib.mkForce base05;
frame_color = lib.mkForce base05;
};
urgency_critical = {
background = lib.mkForce base08;
foreground = lib.mkForce base06;
frame_color = lib.mkForce base05;
};
};
};
};
};
home = {
file = {
".face" = {
# TODO Only works on pindakaas? See https://wiki.archlinux.org/title/LightDM#Changing_your_avatar
source =
pkgs.runCommand "face.png" { }
"${pkgs.inkscape}/bin/inkscape ${./face.svg} -w 1024 -o $out";
source = pkgs.runCommand "face.png" { } "${pkgs.inkscape}/bin/inkscape ${./face.svg} -w 1024 -o $out";
};
};
packages = with pkgs; [

View file

@ -1,25 +1,17 @@
{
pkgs ? import <nixpkgs> {
config = { };
overlays = [ ];
},
...
}:
{ pkgs ? import <nixpkgs> { config = { }; overlays = [ ]; }, ... }:
let
lemonbar = (
pkgs.lemonbar-xft.overrideAttrs (old: {
src = pkgs.fetchFromGitHub {
owner = "drscream";
repo = "lemonbar-xft";
rev = "a64a2a6a6d643f4d92f9d7600722710eebce7bdb";
sha256 = "sha256-T5FhEPIiDt/9paJwL9Sj84CBtA0YFi1hZz0+87Hd6jU=";
# https://github.com/drscream/lemonbar-xft/pull/2
};
})
);
lemonbar = (pkgs.lemonbar-xft.overrideAttrs (old: {
src = pkgs.fetchFromGitHub {
owner = "drscream";
repo = "lemonbar-xft";
rev = "a64a2a6a6d643f4d92f9d7600722710eebce7bdb";
sha256 = "sha256-T5FhEPIiDt/9paJwL9Sj84CBtA0YFi1hZz0+87Hd6jU=";
# https://github.com/drscream/lemonbar-xft/pull/2
};
}));
in
# Tried using pyproject.nix but mpd2 dependency wouldn't resolve,
# is called pyton-mpd2 on PyPi but mpd2 in nixpkgs.
# is called pyton-mpd2 on PyPi but mpd2 in nixpkgs.
pkgs.python3Packages.buildPythonApplication rec {
pname = "frobar";
version = "2.0";
@ -33,12 +25,7 @@ pkgs.python3Packages.buildPythonApplication rec {
pulsectl
pyinotify
];
nativeBuildInputs =
[ lemonbar ]
++ (with pkgs; [
wirelesstools
playerctl
]);
nativeBuildInputs = [ lemonbar ] ++ (with pkgs; [ wirelesstools playerctl ]);
makeWrapperArgs = [ "--prefix PATH : ${pkgs.lib.makeBinPath nativeBuildInputs}" ];
src = ./.;

View file

@ -874,7 +874,7 @@ class MprisProvider(Section, ThreadedUpdater):
"{{ playerName }} {{ status }}",
"{{ album }}",
"{{ artist }}",
"{{ duration(position) }}/{{ duration(mpris:length) }}" " {{ title }}",
"{{ duration(position) }}|{{ duration(mpris:length) }}" " {{ title }}",
]
# nf-fd icons don't work (UTF-16?)
@ -894,8 +894,6 @@ class MprisProvider(Section, ThreadedUpdater):
3: "",
}
MAX_SECTION_LENGTH = 40
def __init__(self, theme: int | None = None):
ThreadedUpdater.__init__(self)
Section.__init__(self, theme)
@ -928,8 +926,6 @@ class MprisProvider(Section, ThreadedUpdater):
if text:
if i in self.ICONS:
text = f"{self.ICONS[i]} {text}"
if len(text) > self.MAX_SECTION_LENGTH:
text = text[: self.MAX_SECTION_LENGTH - 1] + ""
section.updateText(text)
else:
section.updateText(None)

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = lib.mkIf config.frogeye.desktop.xorg {
xsession.windowManager.i3.config.bars = [ ];
@ -20,12 +15,10 @@
Service = {
# Wait for i3 to start. Can't use ExecStartPre because otherwise it blocks graphical-session.target, and there's nothing i3/systemd
# TODO Do that better
ExecStart = ''${pkgs.bash}/bin/bash -c "while ! ${pkgs.i3}/bin/i3-msg; do ${pkgs.coreutils}/bin/sleep 1; done; ${pkgs.callPackage ./. { }}/bin/frobar"'';
ExecStart = ''${pkgs.bash}/bin/bash -c "while ! ${pkgs.i3}/bin/i3-msg; do ${pkgs.coreutils}/bin/sleep 1; done; ${pkgs.callPackage ./. {}}/bin/frobar"'';
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
Install = { WantedBy = [ "graphical-session.target" ]; };
};
};
}

View file

@ -1,59 +1,33 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
let
# FOCUS
focus = "exec ${pkgs.writeShellScript "i3-focus-window" ''
focus = "exec ${ pkgs.writeShellScript "i3-focus-window" ''
WINDOW=`${pkgs.xdotool}/bin/xdotool getwindowfocus`
eval `${pkgs.xdotool}/bin/xdotool getwindowgeometry --shell $WINDOW` # this brings in variables WIDTH and HEIGHT
TX=`${pkgs.coreutils}/bin/expr $WIDTH / 2`
TY=`${pkgs.coreutils}/bin/expr $HEIGHT / 2`
${pkgs.xdotool}/bin/xdotool mousemove -window $WINDOW $TX $TY
''}";
''
}";
# CARDINALS
cardinals = [
{
vi = "h";
arrow = "Left";
container = "left";
workspace = "prev_on_output";
output = "left";
}
{
vi = "l";
arrow = "Right";
container = "right";
workspace = "next_on_output";
output = "right";
}
{
vi = "j";
arrow = "Down";
container = "down";
workspace = "prev";
output = "below";
}
{
vi = "k";
arrow = "Up";
container = "up";
workspace = "next";
output = "above";
}
{ vi = "h"; arrow = "Left"; container = "left"; workspace = "prev_on_output"; output = "left"; }
{ vi = "l"; arrow = "Right"; container = "right"; workspace = "next_on_output"; output = "right"; }
{ vi = "j"; arrow = "Down"; container = "down"; workspace = "prev"; output = "below"; }
{ vi = "k"; arrow = "Up"; container = "up"; workspace = "next"; output = "above"; }
];
forEachCardinal = f: map (c: f c) cardinals;
# WORKSPACES
workspaces_keys = lib.strings.stringToCharacters "1234567890";
workspaces = map (i: {
id = i;
name = builtins.toString (i + 1);
key = builtins.elemAt workspaces_keys i;
}) (lib.lists.range 0 ((builtins.length workspaces_keys) - 1));
workspaces = map
(i: {
id = i;
name = builtins.toString (i + 1);
key = builtins.elemAt workspaces_keys i;
})
(lib.lists.range 0 ((builtins.length workspaces_keys) - 1));
forEachWorkspace = f: map (w: f w) workspaces;
# MISC
@ -65,7 +39,6 @@ in
{
config = lib.mkIf config.xsession.windowManager.i3.enable {
stylix.targets.i3.enable = false;
services.picom.enable = true;
xdg.configFile = {
"rofimoji.rc" = {
text = ''
@ -81,47 +54,13 @@ in
names = [ config.stylix.fonts.sansSerif.name ];
};
terminal = "alacritty";
colors =
let
ignore = "#ff00ff";
in
with config.lib.stylix.colors.withHashtag;
lib.mkForce {
focused = {
border = base0B;
background = base0B;
text = base00;
indicator = base00;
childBorder = base0B;
};
focusedInactive = {
border = base02;
background = base02;
text = base05;
indicator = base02;
childBorder = base02;
};
unfocused = {
border = base05;
background = base04;
text = base00;
indicator = base04;
childBorder = base00;
};
urgent = {
border = base0F;
background = base08;
text = base00;
indicator = base08;
childBorder = base0F;
};
placeholder = {
border = ignore;
background = base00;
text = base05;
indicator = ignore;
childBorder = base00;
};
colors = let ignore = "#ff00ff"; in
with config.lib.stylix.colors.withHashtag; lib.mkForce {
focused = { border = base0B; background = base0B; text = base00; indicator = base00; childBorder = base0B; };
focusedInactive = { border = base02; background = base02; text = base05; indicator = base02; childBorder = base02; };
unfocused = { border = base05; background = base04; text = base00; indicator = base04; childBorder = base00; };
urgent = { border = base0F; background = base08; text = base00; indicator = base08; childBorder = base0F; };
placeholder = { border = ignore; background = base00; text = base05; indicator = ignore; childBorder = base00; };
background = base07;
# I set the color of the active tab as the the background color of the terminal so they merge together.
};
@ -143,10 +82,12 @@ in
# Start Applications
"${mod}+p" = "exec ${pkgs.xfce.thunar}/bin/thunar";
# Misc
"${mod}+F10" = "exec ${pkgs.writeShellScript "show-keyboard-layout" ''
layout=`${pkgs.xorg.setxkbmap}/bin/setxkbmap -query | ${pkgs.gnugrep}/bin/grep ^layout: | ${pkgs.gawk}/bin/awk '{ print $2 }'`
${pkgs.libgnomekbd}/bin/gkbd-keyboard-display -l $layout
''}";
"${mod}+F10" = "exec ${ pkgs.writeShellScript "show-keyboard-layout"
''
layout=`${pkgs.xorg.setxkbmap}/bin/setxkbmap -query | ${pkgs.gnugrep}/bin/grep ^layout: | ${pkgs.gawk}/bin/awk '{ print $2 }'`
${pkgs.libgnomekbd}/bin/gkbd-keyboard-display -l $layout
''
}";
# workspace back and forth (with/without active container)
"${mod}+b" = "workspace back_and_forth; ${focus}";
"${mod}+Shift+b" = "move container to workspace back_and_forth; workspace back_and_forth; ${focus}";
@ -166,55 +107,38 @@ in
"${mod}+Shift+c" = "reload";
"${mod}+Shift+r" = "restart";
"${mod}+Shift+e" = "exit";
}
// lib.mapAttrs' (k: v: lib.nameValuePair v.enter "mode ${v.name}") (
lib.filterAttrs (k: v: v.enter != null) modes
)
// lib.attrsets.mergeAttrsList (
forEachCardinal (c: {
# change focus
"${mod}+${c.vi}" = "focus ${c.container}; ${focus}";
# move focused window
"${mod}+Shift+${c.vi}" = "move ${c.container}; ${focus}";
#navigate workspaces next / previous
"${mod}+Ctrl+${c.vi}" = "workspace ${c.workspace}; ${focus}";
# Move to workspace next / previous with focused container
"${mod}+Ctrl+Shift+${c.vi}" = "move container to workspace ${c.workspace}; workspace ${c.workspace}; ${focus}";
# move workspaces to screen (arrow keys)
"${mod}+Ctrl+Shift+${c.arrow}" = "move workspace to output ${c.output}; ${focus}";
})
)
// lib.attrsets.mergeAttrsList (
forEachWorkspace (w: {
# Switch to workspace
"${mod}+${w.key}" = "workspace ${w.name}; ${focus}";
# move focused container to workspace
"${mod}+ctrl+${w.key}" = "move container to workspace ${w.name}; ${focus}";
# move to workspace with focused container
"${mod}+shift+${w.key}" = "move container to workspace ${w.name}; workspace ${w.name}; ${focus}";
})
);
modes = lib.mapAttrs' (
k: v:
lib.nameValuePair v.name (
v.bindings
// lib.optionalAttrs v.return_bindings {
"Return" = "mode default";
"Escape" = "mode default";
}
)
) modes;
} // lib.mapAttrs' (k: v: lib.nameValuePair v.enter "mode ${v.name}") (lib.filterAttrs (k: v: v.enter != null) modes)
// lib.attrsets.mergeAttrsList (forEachCardinal (c: {
# change focus
"${mod}+${c.vi}" = "focus ${c.container}; ${focus}";
# move focused window
"${mod}+Shift+${c.vi}" = "move ${c.container}; ${focus}";
#navigate workspaces next / previous
"${mod}+Ctrl+${c.vi}" = "workspace ${c.workspace}; ${focus}";
# Move to workspace next / previous with focused container
"${mod}+Ctrl+Shift+${c.vi}" = "move container to workspace ${c.workspace}; workspace ${c.workspace}; ${focus}";
# move workspaces to screen (arrow keys)
"${mod}+Ctrl+Shift+${c.arrow}" = "move workspace to output ${c.output}; ${focus}";
})) // lib.attrsets.mergeAttrsList (forEachWorkspace (w: {
# Switch to workspace
"${mod}+${w.key}" = "workspace ${w.name}; ${focus}";
# move focused container to workspace
"${mod}+ctrl+${w.key}" = "move container to workspace ${w.name}; ${focus}";
# move to workspace with focused container
"${mod}+shift+${w.key}" = "move container to workspace ${w.name}; workspace ${w.name}; ${focus}";
}));
modes = lib.mapAttrs'
(k: v: lib.nameValuePair v.name (v.bindings // lib.optionalAttrs v.return_bindings {
"Return" = "mode default";
"Escape" = "mode default";
}))
modes;
window = {
hideEdgeBorders = "both";
titlebar = false; # So that single-container screens are basically almost fullscreen
commands = [
# switch to workspace with urgent window automatically
{
criteria = {
urgent = "latest";
};
command = "focus";
}
{ criteria = { urgent = "latest"; }; command = "focus"; }
];
};
floating = {
@ -226,26 +150,19 @@ in
startup = [
{
notification = false;
command = "${
pkgs.writeShellApplication {
name = "batteryNotify";
runtimeInputs = with pkgs; [
coreutils
libnotify
];
text = builtins.readFile ./batteryNotify.sh;
# TODO Use batsignal instead?
# TODO Only on computers with battery
}
}/bin/batteryNotify";
command = "${pkgs.writeShellApplication {
name = "batteryNotify";
runtimeInputs = with pkgs; [coreutils libnotify];
text = builtins.readFile ./batteryNotify.sh;
# TODO Use batsignal instead?
# TODO Only on computers with battery
}}/bin/batteryNotify";
}
];
workspaceLayout = "tabbed";
focus.mouseWarping = true; # i3 only supports warping to workspace, hence ${focus}
workspaceOutputAssign = forEachWorkspace (w: {
output = builtins.elemAt x11_screens (lib.mod w.id (builtins.length x11_screens));
workspace = w.name;
});
workspaceOutputAssign =
forEachWorkspace (w: { output = builtins.elemAt x11_screens (lib.mod w.id (builtins.length x11_screens)); workspace = w.name; });
};
frogeye.desktop.i3.bindmodes = {
"Resize" = {
@ -273,34 +190,29 @@ in
options = {
frogeye.desktop.i3.bindmodes = lib.mkOption {
default = { };
type = lib.types.attrsOf (
lib.types.submodule (
{ config, name, ... }:
{
options = {
name = lib.mkOption {
type = lib.types.str;
default = name;
};
bindings = lib.mkOption {
type = lib.types.attrsOf lib.types.str;
default = { };
};
enter = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = "${mod}+${config.mod_enter}";
};
mod_enter = lib.mkOption {
type = lib.types.str;
};
return_bindings = lib.mkOption {
type = lib.types.bool;
default = true;
};
};
}
)
);
type = lib.types.attrsOf (lib.types.submodule ({ config, name, ... }: {
options = {
name = lib.mkOption {
type = lib.types.str;
default = name;
};
bindings = lib.mkOption {
type = lib.types.attrsOf lib.types.str;
default = { };
};
enter = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = "${mod}+${config.mod_enter}";
};
mod_enter = lib.mkOption {
type = lib.types.str;
};
return_bindings = lib.mkOption {
type = lib.types.bool;
default = true;
};
};
}));
};
};
}

View file

@ -1,17 +1,8 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
let
# lockColors = with config.lib.stylix.colors.withHashtag; { a = base00; b = base01; d = base00; }; # Black or White, depending on current theme
# lockColors = with config.lib.stylix.colors.withHashtag; { a = base0A; b = base0B; d = base00; }; # Green + Yellow
lockColors = {
a = "#82a401";
b = "#466c01";
d = "#648901";
}; # Old
lockColors = { a = "#82a401"; b = "#466c01"; d = "#648901"; }; # Old
lockSvg = pkgs.writeText "lock.svg" ''
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" height="50" width="50">
<path fill="${lockColors.a}" d="M0 50h50V0H0z"/>
@ -43,9 +34,7 @@ in
}
trap revert SIGHUP SIGINT SIGTERM
${pkgs.xorg.xset}/bin/xset dpms 5 5 5
${pkgs.i3lock}/bin/i3lock --nofork --color ${
builtins.substring 1 6 lockColors.d
} --image="$pattern" --tiling --ignore-empty-password
${pkgs.i3lock}/bin/i3lock --nofork --color ${builtins.substring 1 6 lockColors.d} --image="$pattern" --tiling --ignore-empty-password
revert
fi
'';
@ -72,13 +61,10 @@ in
};
startup = [
# Stop screen after 10 minutes, 1 minutes after lock it
{
notification = false;
command = "${pkgs.writeShellScript "xautolock-start" ''
{ notification = false; command = "${pkgs.writeShellScript "xautolock-start" ''
echo enabled > ${xautolockState}
${pkgs.xautolock}/bin/xautolock -time 10 -locker '${pkgs.xorg.xset}/bin/xset dpms force standby' -killtime 1 -killer xlock
''}";
}
''}"; }
# services.screen-locker.xautolock is hardcoded to use systemd for -locker (doesn't even work...)
];
};

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = lib.mkIf config.frogeye.desktop.xorg {
home = {
@ -58,10 +53,11 @@
};
};
};
xsession.windowManager.i3.config.keybindings = {
"XF86AudioPrev" = "exec ${lib.getExe pkgs.playerctl} previous";
"XF86AudioPlay" = "exec ${lib.getExe pkgs.playerctl} play-pause";
"XF86AudioNext" = "exec ${lib.getExe pkgs.playerctl} next";
};
xsession.windowManager.i3.config.keybindings =
{
"XF86AudioPrev" = "exec ${lib.getExe pkgs.playerctl} previous";
"XF86AudioPlay" = "exec ${lib.getExe pkgs.playerctl} play-pause";
"XF86AudioNext" = "exec ${lib.getExe pkgs.playerctl} next";
};
};
}

View file

@ -2,12 +2,7 @@
# Not tested since Nix.
# Config mentions pdfpc, although the last thing I used was Impressive, even made patches to it.
# UPST Add Impressive to nixpkgs
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
let
mode_pres_main = "Presentation (main display)";
mode_pres_sec = "Presentation (secondary display)";
@ -36,20 +31,8 @@ in
};
xsession.windowManager.i3.config.window.commands = [
# Open specific applications in floating mode
{
criteria = {
title = "^pdfpc.*";
window_role = "presenter";
};
command = "move to output left, fullscreen";
}
{
criteria = {
title = "^pdfpc.*";
window_role = "presentation";
};
command = "move to output right, fullscreen";
}
{ criteria = { title = "^pdfpc.*"; window_role = "presenter"; }; command = "move to output left, fullscreen"; }
{ criteria = { title = "^pdfpc.*"; window_role = "presentation"; }; command = "move to output right, fullscreen"; }
];
};

View file

@ -1,16 +1,12 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
let
# UPST
sct = pkgs.sct.overrideAttrs (old: {
patches = (old.patches or [ ]) ++ [
./sct_aarch64.patch
];
});
sct = pkgs.sct.overrideAttrs
(old: {
patches = (old.patches or [ ]) ++ [
./sct_aarch64.patch
];
});
in
{
config = lib.mkIf config.frogeye.desktop.xorg {

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
let
dir = config.xdg.userDirs.extraConfig.XDG_SCREENSHOTS_DIR;
scrot = "${pkgs.scrot}/bin/scrot --exec '${pkgs.coreutils}/bin/mv $f ${dir}/ && ${pkgs.optipng}/bin/optipng ${dir}/$f'";

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
let
mod = config.xsession.windowManager.i3.config.modifier;
in
@ -28,28 +23,10 @@ in
bell = {
animation = "EaseOutExpo";
color = "#000000";
command = {
program = "${pkgs.sox}/bin/play";
args = [
"-n"
"synth"
"sine"
"C5"
"sine"
"E4"
"remix"
"1-2"
"fade"
"0.1"
"0.2"
"0.1"
];
};
command = { program = "${pkgs.sox}/bin/play"; args = [ "-n" "synth" "sine" "C5" "sine" "E4" "remix" "1-2" "fade" "0.1" "0.2" "0.1" ]; };
duration = 100;
};
cursor = {
vi_mode_style = "Underline";
};
cursor = { vi_mode_style = "Underline"; };
env = {
WINIT_X11_SCALE_FACTOR = "1";
# Prevents Alacritty from resizing from one monitor to another.
@ -58,68 +35,23 @@ in
hints = {
enabled = [
{
binding = {
mods = "Control|Alt";
key = "F";
};
binding = { mods = "Control|Alt"; key = "F"; };
command = "${pkgs.xdg-utils}/bin/xdg-open";
mouse = {
enabled = true;
mods = "Control";
};
mouse = { enabled = true; mods = "Control"; };
post_processing = true;
regex = "(mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\\u0000-\\u001F\\u007F-\\u009F<>\"\\\\s{-}\\\\^`]+";
}
];
};
keyboard.bindings = [
{
mode = "~Search";
mods = "Alt|Control";
key = "Space";
action = "ToggleViMode";
}
{
mode = "Vi|~Search";
mods = "Control";
key = "K";
action = "ScrollHalfPageUp";
}
{
mode = "Vi|~Search";
mods = "Control";
key = "J";
action = "ScrollHalfPageDown";
}
{
mode = "~Vi";
mods = "Control|Alt";
key = "V";
action = "Paste";
}
{
mods = "Control|Alt";
key = "C";
action = "Copy";
}
{
mode = "~Search";
mods = "Control|Alt";
key = "F";
action = "SearchForward";
}
{
mode = "~Search";
mods = "Control|Alt";
key = "B";
action = "SearchBackward";
}
{
mode = "Vi|~Search";
mods = "Control|Alt";
key = "C";
action = "ClearSelection";
}
{ mode = "~Search"; mods = "Alt|Control"; key = "Space"; action = "ToggleViMode"; }
{ mode = "Vi|~Search"; mods = "Control"; key = "K"; action = "ScrollHalfPageUp"; }
{ mode = "Vi|~Search"; mods = "Control"; key = "J"; action = "ScrollHalfPageDown"; }
{ mode = "~Vi"; mods = "Control|Alt"; key = "V"; action = "Paste"; }
{ mods = "Control|Alt"; key = "C"; action = "Copy"; }
{ mode = "~Search"; mods = "Control|Alt"; key = "F"; action = "SearchForward"; }
{ mode = "~Search"; mods = "Control|Alt"; key = "B"; action = "SearchBackward"; }
{ mode = "Vi|~Search"; mods = "Control|Alt"; key = "C"; action = "ClearSelection"; }
];
window = {
dynamic_padding = false;

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = lib.mkIf config.frogeye.dev.c {
frogeye = {

View file

@ -1,87 +1,77 @@
{ pkgs, config, ... }:
{
{ pkgs, config, ... }: {
# TODO Maybe should be per-directory dotenv
# Or not, for neovim
config = {
# Always on
home.packages =
with pkgs;
[
# Common
perf-tools
jq
yq
universal-ctags
cloc
home.packages = with pkgs; [
# Common
perf-tools
jq
yq
universal-ctags
cloc
# Network
socat
dig
whois
nmap
tcpdump
mtr
traceroute
# Network
socat
dig
whois
nmap
tcpdump
mtr
traceroute
# nix
lix
nixfmt-rfc-style
# nix
lix
nixpkgs-fmt
# Always on (graphical)
]
++ lib.optionals config.frogeye.desktop.xorg [
# Common
# zeal-qt6 # Offline documentation
sqlitebrowser
# Always on (graphical)
] ++ lib.optionals config.frogeye.desktop.xorg [
# Common
# zeal-qt6 # Offline documentation
sqlitebrowser
# Network
wireshark-qt
# Network
wireshark-qt
# Ansible
]
++ lib.optionals config.frogeye.dev.ansible [
ansible
ansible-lint
# Ansible
] ++ lib.optionals config.frogeye.dev.ansible [
ansible
ansible-lint
# Docker
]
++ lib.optionals config.frogeye.dev.docker [
docker
docker-compose
# Docker
] ++ lib.optionals config.frogeye.dev.docker [
docker
docker-compose
# FPGA
]
++ lib.optionals config.frogeye.dev.fpga [
verilog
# FPGA
] ++ lib.optionals config.frogeye.dev.fpga [
verilog
]
++ lib.optionals (config.frogeye.dev.fpga && pkgs.stdenv.isx86_64) [
ghdl
] ++ lib.optionals (config.frogeye.dev.fpga && pkgs.stdenv.isx86_64) [
ghdl
# FPGA (graphical)
]
++ lib.optionals (config.frogeye.desktop.xorg && config.frogeye.dev.fpga) [
yosys
gtkwave
# FPGA (graphical)
] ++ lib.optionals (config.frogeye.desktop.xorg && config.frogeye.dev.fpga) [
yosys
gtkwave
# VM (graphical)
]
++ lib.optionals (config.frogeye.desktop.xorg && config.frogeye.dev.vm) [
virt-manager
];
# VM (graphical)
] ++ lib.optionals (config.frogeye.desktop.xorg && config.frogeye.dev.vm) [
virt-manager
];
programs.nixvim.plugins.lsp.servers = {
ansiblels.enable = config.frogeye.dev.ansible; # Ansible
bashls.enable = true; # Bash
jsonls.enable = true; # JSON
lua_ls.enable = true; # Lua (for Neovim debugging)
lua-ls.enable = true; # Lua (for Neovim debugging)
perlpls.enable = config.frogeye.dev.perl; # Perl
phpactor.enable = config.frogeye.dev.php; # PHP
# Nix
nil_ls = {
nil-ls = {
enable = true;
settings = {
formatting.command = [ "nixfmt" ];
formatting.command = [ "nixpkgs-fmt" ];
nix.flake = {
autoArchive = true;
autoEvalInputs = true;

View file

@ -1,5 +1,4 @@
{ pkgs, config, ... }:
{
{ pkgs, config, ... }: {
imports = [
./c.nix
./common.nix

View file

@ -1,10 +1,5 @@
# Untested post-nix
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = lib.mkIf config.frogeye.dev.go {
frogeye = {

View file

@ -1,10 +1,5 @@
# Untested post-nix
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = lib.mkIf config.frogeye.dev.node {
frogeye = {

View file

@ -1,10 +1,5 @@
# Prose is a programming language, fight me
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = lib.mkIf config.frogeye.dev.prose {
home = {
@ -20,18 +15,12 @@
programs.nixvim = {
autoCmd = [
# vim-easy-align: Align Markdown tables with |
{
event = "FileType";
pattern = "markdown";
command = "vmap <Bar> :EasyAlign*<Bar><Enter>";
}
{ event = "FileType"; pattern = "markdown"; command = "vmap <Bar> :EasyAlign*<Bar><Enter>"; }
];
extraPlugins = with pkgs.vimPlugins; lib.optionals config.programs.pandoc.enable [
vim-pandoc # Pandoc-specific stuff because there's no LSP for it
vim-pandoc-syntax
];
extraPlugins =
with pkgs.vimPlugins;
lib.optionals config.programs.pandoc.enable [
vim-pandoc # Pandoc-specific stuff because there's no LSP for it
vim-pandoc-syntax
];
extraConfigVim = lib.optionalString config.programs.pandoc.enable ''
let g:pandoc#modules#disabled = ["folding"]
let g:pandoc#spell#enabled = 0

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = lib.mkIf config.frogeye.dev.python {
home = {

67
hm/extra.nix Normal file
View file

@ -0,0 +1,67 @@
{ pkgs, lib, config, ... }:
{
config = lib.mkIf config.frogeye.extra {
programs = {
pandoc.enable = true;
yt-dlp = {
enable = true;
settings = {
format = "bestvideo[height<=${builtins.toString config.frogeye.desktop.maxVideoHeight}]+bestaudio/best";
sponsorblock-mark = "all";
sponsorblock-remove = "intro,outro,sponsor,selfpromo,preview,interaction,music_offtopic";
sub-langs = "en,fr";
write-auto-subs = true;
write-subs = true;
};
};
};
home.packages = with pkgs; ([
# android tools
android-tools
# Communication
signal-desktop
# downloading
# transmission TODO Collision if both transmissions are active?
# Multimedia toolbox
ffmpeg
# documents
visidata
# texlive.combined.scheme-full
# TODO Convert existing LaTeX documents into using Nix build system
# texlive is big and not that much used, sooo
pdftk
pdfgrep
# Misc
haskellPackages.dice
rustdesk-flutter
] ++ lib.optionals config.frogeye.desktop.xorg [
# multimedia editors
darktable
puddletag
audacity
xournalpp
krita
# downloading
transmission-qt
# wine only makes sense on x86_64
] ++ lib.optionals pkgs.stdenv.isx86_64 [
wine
# TODO wine-gecko wine-mono lib32-libpulse (?)
] ++ lib.optionals (!stdenv.isAarch64) [
# Musescore is broken on aarch64
musescore
# Blender 4.0.1 can't compile on aarch64
# https://hydra.nixos.org/job/nixos/release-23.11/nixpkgs.blender.aarch64-linux
blender
]);
};
}

View file

@ -1,80 +0,0 @@
{
pkgs,
lib,
config,
...
}:
{
config = lib.mkIf config.frogeye.extra {
programs = {
pandoc.enable = true;
yt-dlp = {
enable = true;
settings = {
format = "bestvideo[height<=${builtins.toString config.frogeye.desktop.maxVideoHeight}]+bestaudio/best";
sponsorblock-mark = "all";
sponsorblock-remove = "intro,outro,sponsor,selfpromo,preview,interaction,music_offtopic";
sub-langs = "en,fr";
write-auto-subs = true;
write-subs = true;
};
};
};
home.packages =
with pkgs;
(
[
# android tools
android-tools
# Communication
signal-desktop
(pkgs.callPackage ./whisperx.nix { }) # Transcribe voice messages
# downloading
# transmission TODO Collision if both transmissions are active?
# Multimedia toolbox
ffmpeg
# documents
visidata
# texlive.combined.scheme-full
# TODO Convert existing LaTeX documents into using Nix build system
# texlive is big and not that much used, sooo
pdftk
pdfgrep
# Misc
haskellPackages.dice
rustdesk-flutter
]
++ lib.optionals config.frogeye.desktop.xorg [
# multimedia editors
darktable
puddletag
audacity
xournalpp
krita
# downloading
transmission_4-qt
# wine only makes sense on x86_64
]
++ lib.optionals pkgs.stdenv.isx86_64 [
wine
# TODO wine-gecko wine-mono lib32-libpulse (?)
]
++ lib.optionals (!stdenv.isAarch64) [
# Musescore is broken on aarch64
musescore
# Blender 4.0.1 can't compile on aarch64
# https://hydra.nixos.org/job/nixos/release-23.11/nixpkgs.blender.aarch64-linux
blender
]
);
};
}

View file

@ -1,44 +0,0 @@
{
pkgs ? import <nixpkgs> { },
}:
pkgs.python3Packages.buildPythonPackage rec {
pname = "whisperx";
version = "3.2.0";
# pypi doesn't have the requirements.txt file, and it's required
src = pkgs.fetchFromGitHub {
owner = "m-bain";
repo = "whisperX";
rev = "v${version}"; # git doesn't have tags
hash = "sha256-JQvyR9JW8OiSRI0eywTyWB4VMXmu6cTpBekBWonoJa4=";
};
pyproject = true;
dependencies = [
pkgs.python3Packages.torch
pkgs.python3Packages.torchaudio
(pkgs.python3Packages.faster-whisper.overrideAttrs (old: {
# 1.0.2 is actually breaking APIs (requires hotwords argument)
src = pkgs.fetchFromGitHub {
owner = "SYSTRAN";
repo = "faster-whisper";
rev = "v1.0.0";
hash = "sha256-0fE8X1d6CgDrrHtRudksN/tIGRtBKMvoNwkSVyFNda4=";
};
}))
pkgs.python3Packages.transformers
pkgs.python3Packages.pyannote-audio # Not in the requirements.txt for some reason
pkgs.python3Packages.pandas
pkgs.python3Packages.nltk
];
pythonRelaxDeps = true;
# torchaudio: 2.5.1a0 is >=2, despite dependency check saying otherwise
# ctranslate2: was pinned to 4.4.0 to fix some nvidia pinning issue or whatnot
# pyannote-audio: not sure what pins this to 3.1.1, but 3.3.1 works fine
# For some reason pyannote-audio doesn't get relaxed when listed in a pythonRelaxDeps array,
# hence why using true
build-system = [
pkgs.python3Packages.setuptools
];
pythonImportsCheck = [
"whisperx"
];
}

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = lib.mkIf config.frogeye.gaming {
# Using config.nixpkgs.<something> creates an infinite recursion,

View file

@ -1,24 +1,15 @@
{
pkgs,
lib,
config,
jjuinixpkgs,
...
}:
{ pkgs, lib, config, unixpkgs, ... }:
let
cfg = config.programs.git;
jjuipkgs = import jjuinixpkgs { inherit (pkgs) system; };
in
{
config = lib.mkIf cfg.enable {
home.packages = [
jjuipkgs.jjui
pkgs.lazyjj
(pkgs.writeShellApplication {
name = "git-sync";
text = (
lib.strings.concatLines (
map (r: ''
text = (lib.strings.concatLines
(map
(r: ''
echo "===== ${r.path}"
if [ ! -d "${r.path}" ]
then
@ -40,7 +31,8 @@ in
fi
)
fi
'') (lib.attrsets.attrValues config.services.git-sync.repositories)
'')
(lib.attrsets.attrValues config.services.git-sync.repositories)
)
);
})
@ -70,27 +62,28 @@ in
lfs.enable = true;
userEmail = lib.mkDefault "geoffrey@frogeye.fr";
userName = lib.mkDefault "Geoffrey Frogeye";
extraConfig =
{
core = {
editor = "nvim";
};
push = {
default = "matching";
};
pull = {
ff = "only";
};
}
// lib.optionalAttrs config.frogeye.desktop.xorg {
diff.tool = "meld";
difftool.prompt = false;
"difftool \"meld\"".cmd = "${pkgs.meld}/bin/meld \"$LOCAL\" \"$REMOTE\"";
# This escapes quotes, which isn't the case in the original, hoping this isn't an issue.
extraConfig = {
core = {
editor = "nvim";
};
push = {
default = "matching";
};
pull = {
ff = "only";
};
} // lib.optionalAttrs config.frogeye.desktop.xorg {
diff.tool = "meld";
difftool.prompt = false;
"difftool \"meld\"".cmd = "${pkgs.meld}/bin/meld \"$LOCAL\" \"$REMOTE\"";
# This escapes quotes, which isn't the case in the original, hoping this isn't an issue.
};
};
jujutsu = {
enable = true;
package = (import unixpkgs {
inherit (pkgs) system;
}).jujutsu;
# Current version doesn't have the "none" signing backend
settings = {
git = {

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = lib.mkIf config.programs.gpg.enable {
frogeye.hooks.lock = ''
@ -31,15 +26,13 @@
default-preference-list = "SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed";
personal-cipher-preferences = "TWOFISH CAMELLIA256 AES 3DES";
};
publicKeys = [
{
source = builtins.fetchurl {
url = "https://keys.openpgp.org/vks/v1/by-fingerprint/4FBA930D314A03215E2CDB0A8312C8CAC1BAC289";
sha256 = "sha256:10y9xqcy1vyk2p8baay14p3vwdnlwynk0fvfbika65hz2z8yw2cm";
};
trust = "ultimate";
}
];
publicKeys = [{
source = builtins.fetchurl {
url = "https://keys.openpgp.org/vks/v1/by-fingerprint/4FBA930D314A03215E2CDB0A8312C8CAC1BAC289";
sha256 = "sha256:10y9xqcy1vyk2p8baay14p3vwdnlwynk0fvfbika65hz2z8yw2cm";
};
trust = "ultimate";
}];
};
services.gpg-agent = rec {
enableBashIntegration = true;
@ -50,7 +43,7 @@
# It will fall back to ncurses when running in non-graphics mode.
defaultCacheTtl = 3600;
defaultCacheTtlSsh = defaultCacheTtl;
maxCacheTtl = 3 * 3600;
maxCacheTtl = 3*3600;
maxCacheTtlSsh = maxCacheTtl;
};
};

View file

@ -25,19 +25,14 @@
];
};
home = {
activation.createDirenvFolders = lib.hm.dag.entryAfter [ "writeBoundary" ] (
lib.strings.concatLines (
map (d: "mkdir -p ${d}") (
(builtins.attrValues config.frogeye.direnv) ++ [ "${config.xdg.cacheHome}/junkhome" ]
)
)
);
activation.createDirenvFolders = lib.hm.dag.entryAfter [ "writeBoundary" ]
(lib.strings.concatLines (map (d: "mkdir -p ${d}") (
(builtins.attrValues config.frogeye.direnv) ++ [ "${config.xdg.cacheHome}/junkhome" ]
)));
sessionVariables = config.frogeye.direnv;
};
programs.bash.shellAliases = lib.attrsets.mergeAttrsList (
map (p: { "${p}" = "HOME=${config.xdg.cacheHome}/junkhome ${p}"; }) config.frogeye.junkhome
);
programs.bash.shellAliases = lib.attrsets.mergeAttrsList (map (p: { "${p}" = "HOME=${config.xdg.cacheHome}/junkhome ${p}"; }) config.frogeye.junkhome);
};
options.frogeye = {
direnv = lib.mkOption {

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = {
home.packages = with pkgs; [

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = {
home.packages = with pkgs; [
@ -21,10 +16,7 @@
nix = {
package = lib.mkDefault pkgs.lix;
settings = {
experimental-features = [
"nix-command"
"flakes"
];
experimental-features = [ "nix-command" "flakes" ];
warn-dirty = false;
};
};

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
let
mod = config.xsession.windowManager.i3.config.modifier;
in
@ -13,51 +8,32 @@ in
pwgen
(pkgs.writeShellApplication {
name = "install-passwords";
runtimeInputs = [
yq
gawk
moreutils
];
text = (
lib.strings.concatLines (
map (
file:
''
(
echo "===== Preparing to write ${file.path}"
temp="$(mktemp --tmpdir="${builtins.dirOf file.path}")"
cat "${file.template}" > "$temp"
''
+ (lib.strings.concatLines (
map (
password:
(
if password.selector == null then
''
echo "Reading ${password.path} for substituting ${password.variable}"
value="$(pass "${password.path}" | head -n1)"
''
else
''
echo "Reading ${password.path} -> ${password.selector} for substituting ${password.variable}"
value="$(pass "${password.path}" | tail -n +2 | yq -r '.${password.selector}')"
''
)
+ ''
key="${password.variable}"
K="$key" V="$value" awk '{ gsub (ENVIRON["K"], ENVIRON["V"]); print }' "$temp" | sponge "$temp"
''
) (lib.attrsets.attrValues file.passwords)
))
+ ''
echo "Moving the file in place"
chown "${file.owner}" "$temp"
chmod u=r "$temp"
mv -f "$temp" "${file.path}"
)
''
) config.frogeye.passwordFiles
)
runtimeInputs = [ yq gawk moreutils ];
text = (lib.strings.concatLines (map
(file: ''
(
echo "===== Preparing to write ${file.path}"
temp="$(mktemp --tmpdir="${builtins.dirOf file.path}")"
cat "${file.template}" > "$temp"
'' + (lib.strings.concatLines (map
(password: (if password.selector == null then ''
echo "Reading ${password.path} for substituting ${password.variable}"
value="$(pass "${password.path}" | head -n1)"
'' else ''
echo "Reading ${password.path} -> ${password.selector} for substituting ${password.variable}"
value="$(pass "${password.path}" | tail -n +2 | yq -r '.${password.selector}')"
'') + ''
key="${password.variable}"
K="$key" V="$value" awk '{ gsub (ENVIRON["K"], ENVIRON["V"]); print }' "$temp" | sponge "$temp"
'')
(lib.attrsets.attrValues file.passwords))) + ''
echo "Moving the file in place"
chown "${file.owner}" "$temp"
chmod u=r "$temp"
mv -f "$temp" "${file.path}"
)
'')
config.frogeye.passwordFiles)
);
})
];
@ -74,70 +50,63 @@ in
frogeye.passwordFiles =
let
defaultvar = "@PASSWORD@";
pwtype =
{ name, ... }:
{
options = {
variable = lib.mkOption {
type = lib.types.str;
default = name;
description = "String in the template that will be substituted by the actual password";
};
path = lib.mkOption {
type = lib.types.str;
description = "Path to the password store entry";
};
selector = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = "If set, will parse the password metadata as YML and use selector (yq) instead of the password.";
};
pwtype = { name, ... }: {
options = {
variable = lib.mkOption {
type = lib.types.str;
default = name;
description = "String in the template that will be substituted by the actual password";
};
path = lib.mkOption {
type = lib.types.str;
description = "Path to the password store entry";
};
selector = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = "If set, will parse the password metadata as YML and use selector (yq) instead of the password.";
};
};
};
mainConfig = config;
in
lib.mkOption {
default = [ ];
type = lib.types.listOf (
lib.types.submodule (
{ config, ... }:
{
options = {
path = lib.mkOption {
type = lib.types.str;
description = "Where to place the file.";
};
owner = lib.mkOption {
type = lib.types.str;
default = mainConfig.home.username;
description = "Who will own the file.";
};
template = lib.mkOption {
type = lib.types.path;
default = pkgs.writeTextFile {
name = "pwfile-template";
text = config.text;
};
description = "Path to the template used to make the file. Exclusive with `text`.";
};
text = lib.mkOption {
type = lib.types.str;
default = defaultvar;
description = "Content of the template used to make the file. Exclusive with `template`.";
};
passwords = lib.mkOption {
default = lib.optionalAttrs (config.password != null) { ${defaultvar} = config.password; };
type = lib.types.attrsOf (lib.types.submodule pwtype);
description = "Paths to passwords that will substitute the variables in the template. Exclusive with `password`";
};
password = lib.mkOption {
type = lib.types.submodule ({ ... }@args: pwtype (args // { name = defaultvar; }));
description = "Path to password that will substitute '@PASSWORD@' in the template. Exclusive with `passwords`.";
};
type = lib.types.listOf (lib.types.submodule ({ config, ... }: {
options = {
path = lib.mkOption {
type = lib.types.str;
description = "Where to place the file.";
};
owner = lib.mkOption {
type = lib.types.str;
default = mainConfig.home.username;
description = "Who will own the file.";
};
template = lib.mkOption {
type = lib.types.path;
default = pkgs.writeTextFile {
name = "pwfile-template";
text = config.text;
};
}
)
);
description = "Path to the template used to make the file. Exclusive with `text`.";
};
text = lib.mkOption {
type = lib.types.str;
default = defaultvar;
description = "Content of the template used to make the file. Exclusive with `template`.";
};
passwords = lib.mkOption {
default = lib.optionalAttrs (config.password != null) { ${defaultvar} = config.password; };
type = lib.types.attrsOf (lib.types.submodule pwtype);
description = "Paths to passwords that will substitute the variables in the template. Exclusive with `password`";
};
password = lib.mkOption {
type = lib.types.submodule ({ ... }@args: pwtype (args // { name = defaultvar; }));
description = "Path to password that will substitute '@PASSWORD@' in the template. Exclusive with `passwords`.";
};
};
}));
};
};
}

View file

@ -1,27 +1,10 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = lib.mkIf config.programs.less.enable {
programs.powerline-go = {
enable = true;
modules = [
"user"
"host"
"venv"
"cwd"
"perms"
"nix-shell"
"git"
];
modulesRight = [
"jobs"
"exit"
"duration"
];
modules = [ "user" "host" "venv" "cwd" "perms" "nix-shell" "git" ];
modulesRight = [ "jobs" "exit" "duration" ];
settings = {
colorize-hostname = true;
hostname-only-if-ssh = true;

View file

@ -209,15 +209,17 @@ elif sys.argv[1] in ("merge", "mr"):
to_glab()
elif sys.argv[2] == "checkout":
# Bypass the original checkout command so it doesn't run git commands.
mr = glab_get_mr(sys.argv[3])
jj.run("git", "fetch")
jj.run("new", mr.source_branch)
# If there's no commit on the branch, add one with the MR title
# so jj has a current bookmark.
if len(jj.log(f"{mr.source_branch} | {mr.target_branch}")) == 1:
mr = glab_get_mr(sys.argv[3])
jj.run("git", "fetch")
if len(JujutsuCommit.log(f"{mr.source_branch} | {mr.target_branch}")) == 1:
title = re.sub(r"^(WIP|Draft): ", "", mr.title)
jj.run("new", mr.source_branch)
jj.run("describe", "-m", title)
jj.run("bookmark", "move", mr.source_branch)
else:
jj.run("bookmark", "edit", mr.source_branch)
elif sys.argv[2] in (
# If no MR number/branch is given, insert the current bookmark,
# as the current branch concept doesn't exist in jj
@ -250,7 +252,7 @@ elif sys.argv[1] == "push":
bookmark = current_bookmark()
if not bookmark:
raise RuntimeError("Couldn't find a current branch")
heads = jj.log("heads(ancestors(@::) ~ empty())")
heads = jj.log("heads(@::)")
if len(heads) != 1:
raise RuntimeError("Multiple heads") # Or none if something goes horribly wrong
head = heads[0]

View file

@ -1,9 +1,7 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash --pure
#! nix-shell -p bash coreutils imagemagick libjpeg optipng ffmpeg diffutils
# vim: filetype=sh
set -euo pipefail
# Optimizes everything the script can find in a folder,
# meaning it will compress files as much as possible,
@ -15,13 +13,14 @@ set -euo pipefail
# TODO Lots of dupplicated code there
# TODO Maybe replace part with https://github.com/toy/image_optim?
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
dir=${1:-$PWD}
total=$(mktemp)
echo -n 0 > "$total"
echo -n 0 > $total
function showtotal {
echo "Total saved: $(cat "$total") bytes"
rm "$total"
rm $total
exit
}
@ -29,11 +28,11 @@ trap showtotal SIGTERM SIGINT SIGFPE
function doReplace { # candidate original
mv "$c" "$o"
saved=$((os - cs))
perc=$((100 * saved / os))
saved=$(($os - $cs))
perc=$((100 * $saved / $os))
echo "→ $os ⇒ $cs (saved $saved bytes, or ${perc}%)"
newtotal=$(($(cat "$total") + saved))
echo -n $newtotal > "$total"
newtotal=$(($(cat $total) + $saved))
echo -n $newtotal > $total
}
function replace { # candidate original
@ -53,17 +52,17 @@ function replace { # candidate original
# Size verifications
cs=$(wc -c "$c" | cut -d' ' -f1)
os=$(wc -c "$o" | cut -d' ' -f1)
if [ "$cs" -le 0 ]; then
if [ $cs -le 0 ]; then
echo "→ Candidate is empty, skipping!"
rm "$c"
return
fi
if [ "$cs" -eq "$os" ]; then
if [ $cs -eq $os ]; then
echo "→ Candidate weight the same, skipping."
rm "$c"
return
fi
if [ "$cs" -gt "$os" ]; then
if [ $cs -gt $os ]; then
echo "→ Candidate is larger, skipping."
rm "$c"
return
@ -72,75 +71,76 @@ function replace { # candidate original
doReplace "$c" "$o"
}
# function replaceImg { # candidate original
# # With bitmap verification
#
# c="$1"
# o="$2"
#
# # File verifications
# if [ ! -f "$o" ]; then
# echo "→ Original is inexistant, skipping!"
# return
# fi
# if [ ! -f "$c" ]; then
# echo "→ Candidate is inexistant, skipping!"
# return
# fi
#
# # Size verifications
# cs=$(wc -c "$c" | cut -d' ' -f1)
# os=$(wc -c "$o" | cut -d' ' -f1)
# if [ $cs -le 0 ]; then
# echo "→ Candidate is empty, skipping!"
# rm "$c"
# return
# fi
# if [ $cs -eq $os ]; then
# echo "→ Candidate weight the same, skipping."
# rm "$c"
# return
# fi
# if [ $cs -gt $os ]; then
# echo "→ Candidate is larger, skipping."
# rm "$c"
# return
# fi
#
# # Bitmap verification
# ppmc="$(mktemp --suffix .ppm)"
# ppmo="$(mktemp --suffix .ppm)"
# convert "$c" "$ppmc"
# convert "$o" "$ppmo"
#
# if cmp --silent "$ppmo" "$ppmc"; then
# doReplace "$c" "$o"
# else
# echo "→ Candidate don't have the same bit map as original, skipping!"
# fi
# rm -f "$ppmc" "$ppmo" "$c"
#
# }
function replaceImg { # candidate original
# With bitmap verification
c="$1"
o="$2"
# File verifications
if [ ! -f "$o" ]; then
echo "→ Original is inexistant, skipping!"
return
fi
if [ ! -f "$c" ]; then
echo "→ Candidate is inexistant, skipping!"
return
fi
# Size verifications
cs=$(wc -c "$c" | cut -d' ' -f1)
os=$(wc -c "$o" | cut -d' ' -f1)
if [ $cs -le 0 ]; then
echo "→ Candidate is empty, skipping!"
rm "$c"
return
fi
if [ $cs -eq $os ]; then
echo "→ Candidate weight the same, skipping."
rm "$c"
return
fi
if [ $cs -gt $os ]; then
echo "→ Candidate is larger, skipping."
rm "$c"
return
fi
# Bitmap verification
ppmc="$(mktemp --suffix .ppm)"
ppmo="$(mktemp --suffix .ppm)"
convert "$c" "$ppmc"
convert "$o" "$ppmo"
if cmp --silent "$ppmo" "$ppmc"; then
doReplace "$c" "$o"
else
echo "→ Candidate don't have the same bit map as original, skipping!"
fi
rm -f "$ppmc" "$ppmo" "$c"
}
# JPEG (requires jpegtran)
while read -r image
while read image
do
if [ -z "$image" ]; then continue; fi
echo Processing "$image"
echo Processing $image
prog=$(mktemp --suffix .jpg)
jpegtran -copy all -progressive "$image" > "$prog"
echo "→ Progressive done"
progs=$(wc -c "$prog" | cut -d' ' -f1)
replace "$prog" "$image"
done <<< "$(find "$dir/" -type f -iregex ".+.jpe?g$")"
# PNG (requires optipng)
while read -r image
while read image
do
if [ -z "$image" ]; then continue; fi
echo Processing "$image"
echo Processing $image
temp=$(mktemp --suffix .png)
cp "$image" "$temp"
@ -152,13 +152,13 @@ do
done <<< "$(find "$dir/" -type f -iname "*.png")"
# FLAC (requires ffmpeg)
while read -r music
while read music
do
if [ -z "$music" ]; then continue; fi
echo "Processing $music"
echo Processing $music
temp=$(mktemp --suffix .flac)
ffmpeg -nostdin -y -i "$music" -compression_level 8 "$temp"
ffmpeg -y -i "$music" -compression_level 8 "$temp"
echo "→ Optimize done"
replace "$temp" "$music"
@ -186,6 +186,6 @@ done <<< "$(find "$dir/" -type f -iname "*.flac")"
# - I might want to keep editor data and/or ids for some of them
# So rather use scour explicitely when needed
cleandev
${SCRIPT_DIR}/cleandev
showtotal

View file

@ -3,7 +3,7 @@
#! nix-shell -p python3 python3Packages.coloredlogs r128gain
# TODO r128gain is not maintainted anymore
# rsgain replaces it, does the same job as I do with albums
# 24.05 rsgain replaces it, does the same job as I do with albums
# Normalisation is done at the default of each program,
# which is usually -89.0 dB

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = {
programs.atuin = {

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
let
cfg = config.programs.bash;
in
@ -19,11 +14,7 @@ in
historySize = 100000;
historyFile = "${config.xdg.stateHome}/shell_history";
historyFileSize = 100000;
historyControl = [
"erasedups"
"ignoredups"
"ignorespace"
];
historyControl = [ "erasedups" "ignoredups" "ignorespace" ];
};
zsh = {
enable = true;
@ -45,5 +36,5 @@ in
};
imports = [
./atuin.nix
];
];
}

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = {
frogeye.hooks.lock = ''

View file

@ -1,10 +1,4 @@
{
pkgs,
config,
lib,
stylix,
...
}:
{ pkgs, config, lib, stylix, ... }:
{
config = {
stylix = {

View file

@ -1,21 +1,17 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
let
themepack = pkgs.tmuxPlugins.mkTmuxPlugin rec {
pluginName = "tmux-themepack";
version = "1.1.0";
rtpFilePath = "themepack.tmux";
src = pkgs.fetchFromGitHub {
owner = "jimeh";
repo = "tmux-themepack";
rev = "${version}";
sha256 = "f6y92kYsKDFanNx5ATx4BkaB/E7UrmyIHU/5Z01otQE=";
themepack = pkgs.tmuxPlugins.mkTmuxPlugin
rec {
pluginName = "tmux-themepack";
version = "1.1.0";
rtpFilePath = "themepack.tmux";
src = pkgs.fetchFromGitHub {
owner = "jimeh";
repo = "tmux-themepack";
rev = "${version}";
sha256 = "f6y92kYsKDFanNx5ATx4BkaB/E7UrmyIHU/5Z01otQE=";
};
};
};
in
{
config = lib.mkIf config.programs.tmux.enable {
@ -30,9 +26,7 @@ in
plugins = with pkgs.tmuxPlugins; [
sensible
];
extraConfig =
builtins.readFile ./tmux.conf
+ "source-file ${themepack}/share/tmux-plugins/tmux-themepack/powerline/default/green.tmuxtheme\n";
extraConfig = builtins.readFile ./tmux.conf + "source-file ${themepack}/share/tmux-plugins/tmux-themepack/powerline/default/green.tmuxtheme\n";
};
stylix.targets.tmux.enable = false;
xdg.configFile.screenrc.text = (builtins.readFile ./screenrc);

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
let
# UPST
vim-shot-f = pkgs.vimUtils.buildVimPlugin {
@ -58,20 +53,19 @@ in
# Catches attention when cursor changed position
specs = {
enable = true;
settings = {
min_jump = 5;
popup.fader = "require('specs').pulse_fader";
};
min_jump = 5;
fader = { builtin = "pulse_fader"; };
resizer = { builtin = "shrink_resizer"; };
};
# Treesitter
treesitter = {
# Allows for better syntax highlighting
enable = true;
settings = {
incremental_selection.enable = true;
# indent = true; # Not very working last time I tried apparently
incrementalSelection = {
enable = true;
};
# indent = true; # Not very working last time I tried apparently
};
indent-blankline.enable = true; # Show indent guides
rainbow-delimiters.enable = true; # Randomly colore paired brackets

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = {
# Completion

View file

@ -1,97 +1,39 @@
{
pkgs,
lib,
config,
nixvimLib,
...
}:
let
nv = nixvimLib.nixvim;
in
{ pkgs, lib, config, ... }:
{
config = {
programs = {
# https://www.reddit.com/r/neovim/comments/mbj8m5/how_to_setup_ctrlshiftkey_mappings_in_neovim_and/
alacritty.settings.keyboard.bindings =
[
{
key = "H";
mods = "Control|Shift";
chars = "\\u001b[72;5u";
}
{
key = "L";
mods = "Control|Shift";
chars = "\\u001b[76;5u";
}
]
++ (map (n: {
key = "Key${builtins.toString n}";
mods = "Control";
chars = "\\u001b[${builtins.toString (48 + n)};5u";
}) (lib.lists.range 0 9));
alacritty.settings.keyboard.bindings = [
{ key = "H"; mods = "Control|Shift"; chars = "\\u001b[72;5u"; }
{ key = "L"; mods = "Control|Shift"; chars = "\\u001b[76;5u"; }
] ++ (map
(n: { key = "Key${builtins.toString n}"; mods = "Control"; chars = "\\u001b[${builtins.toString (48+n)};5u"; })
(lib.lists.range 0 9));
# Ctrl+<number> doesn't get interpreted, but Ctrl+Shift+<number> does, so let's use that
nixvim = {
autoCmd = [
# Turn off relativenumber only for insert mode
{
event = "InsertEnter";
pattern = "*";
command = "set norelativenumber";
}
{
event = "InsertLeave";
pattern = "*";
command = "set relativenumber";
}
{ event = "InsertEnter"; pattern = "*"; command = "set norelativenumber"; }
{ event = "InsertLeave"; pattern = "*"; command = "set relativenumber"; }
];
extraPlugins = with pkgs.vimPlugins; [
nvim-scrollview # Scroll bar
];
keymaps =
let
options = {
silent = true;
};
options = { silent = true; };
in
[
# barbar
{
key = "gb";
action = "<Cmd>BufferPick<CR>";
inherit options;
}
{
key = "<C-H>";
action = "<Cmd>BufferPrevious<CR>";
inherit options;
}
{
key = "<C-L>";
action = "<Cmd>BufferNext<CR>";
inherit options;
}
{
key = "<C-S-H>";
action = "<Cmd>BufferMovePrevious<CR>";
inherit options;
}
{
key = "<C-S-L>";
action = "<Cmd>BufferMoveNext<CR>";
inherit options;
}
{
key = "<C-0>";
action = "<Cmd>BufferLast<CR>";
inherit options;
}
]
++ (map (n: {
key = "<C-${builtins.toString n}>";
action = "<Cmd>BufferGoto ${builtins.toString n}<CR>";
inherit options;
}) (lib.lists.range 1 9));
{ key = "gb"; action = "<Cmd>BufferPick<CR>"; inherit options; }
{ key = "<C-H>"; action = "<Cmd>BufferPrevious<CR>"; inherit options; }
{ key = "<C-L>"; action = "<Cmd>BufferNext<CR>"; inherit options; }
{ key = "<C-S-H>"; action = "<Cmd>BufferMovePrevious<CR>"; inherit options; }
{ key = "<C-S-L>"; action = "<Cmd>BufferMoveNext<CR>"; inherit options; }
{ key = "<C-0>"; action = "<Cmd>BufferLast<CR>"; inherit options; }
] ++ (map
(n: { key = "<C-${builtins.toString n}>"; action = "<Cmd>BufferGoto ${builtins.toString n}<CR>"; inherit options; })
(lib.lists.range 1 9));
opts = {
showmode = false;
number = true;
@ -103,160 +45,114 @@ in
barbar.enable = true;
# TODO Reload make it use the preset colorscheme
# Status line
lualine =
with config.lib.stylix.colors.withHashtag;
let
normal = {
fg = base05;
bg = base01;
};
inverted = {
fg = base00;
bg = base03;
};
normal_ina = {
fg = base02;
bg = base01;
};
inverted_ina = {
fg = base00;
bg = base02;
};
in
{
enable = true;
settings = rec {
inactive_sections = sections;
sections = {
lualine_a = [
(nv.listToUnkeyedAttrs [ "string.format('%d', vim.fn.line('$'))" ])
];
lualine_b = [ "mode" ];
lualine_c = [
(
(nv.listToUnkeyedAttrs [ "filename" ])
// {
color = nv.mkRaw ''
function(section)
return { fg = vim.bo.modified and '${base08}' or '${normal.fg}' }
end
'';
path = 1; # Relative path
symbols = {
modified = "";
newfile = "󰻭";
readonly = "󰏯";
unnamed = "󱀶";
};
}
)
"location"
];
lualine_x =
[
(
(nv.listToUnkeyedAttrs [ ''(next(vim.lsp.buf_get_clients()) == nil) and "󰒲 " or ""'' ])
// {
separator = {
left = "";
right = "";
};
}
)
]
++ (lib.mapAttrsToList
(
diag_name: diag_color:
(
(nv.listToUnkeyedAttrs [ "diagnostics" ])
// {
color.bg = diag_color;
colored = false;
separator = {
left = "";
right = "";
};
sections = [ diag_name ];
}
)
)
{
error = base08;
warn = base0A;
hint = base0C;
info = base0B;
}
);
lualine_y = [
(
(nv.listToUnkeyedAttrs [ "diff" ])
// {
diff_color = {
added.fg = base0B;
modified.fg = base0A;
removed.fg = base08;
};
symbols = {
added = " ";
modified = " ";
removed = " ";
};
}
)
"branch"
];
lualine_z = [
"filetype"
"fileformat"
"encoding"
];
lualine = with config.lib.stylix.colors.withHashtag; let
normal = { fg = base05; bg = base01; };
inverted = { fg = base00; bg = base03; };
normal_ina = { fg = base02; bg = base01; };
inverted_ina = { fg = base00; bg = base02; };
in
rec {
enable = true;
inactiveSections = sections;
sections = {
lualine_a = [{
name = ''string.format('%d', vim.fn.line('$'))'';
}];
lualine_b = [
"mode"
];
lualine_c = [{
name = "filename";
color = {
__raw = ''
function(section)
return { fg = vim.bo.modified and '${base08}' or '${normal.fg}' }
end
'';
};
options.theme =
(lib.mapAttrs
(mode_name: mode_color: {
a = inverted;
b = inverted // {
bg = mode_color;
gui = "bold";
};
c = normal;
x = inverted;
y = normal;
z = inverted // {
bg = mode_color;
};
})
{
normal = base0D;
insert = base0B;
visual = base0F;
replace = base08;
command = base0E;
}
)
// {
inactive = {
a = inverted_ina;
b = normal_ina // {
bg = base00;
gui = "bold";
};
c = normal_ina;
x = inverted_ina;
y = normal_ina;
z = normal_ina // {
bg = base00;
};
};
extraConfig = {
path = 1; # Relative path
symbols = {
modified = "";
newfile = "󰻭";
readonly = "󰏯";
unnamed = "󱀶";
};
};
}
"location"];
lualine_x = [{
name = ''(next(vim.lsp.buf_get_clients()) == nil) and "󰒲 " or ""'';
extraConfig.separator = { left = ""; right = ""; };
}] ++ (lib.mapAttrsToList
(diag_name: diag_color: {
name = "diagnostics";
extraConfig = {
color.bg = diag_color;
colored = false;
separator = { left = ""; right = ""; };
sections = [ diag_name ];
};
})
{
error = base08;
warn = base0A;
hint = base0C;
info = base0B;
});
lualine_y = [{
name = "diff";
extraConfig = {
diff_color = {
added.fg = base0B;
modified.fg = base0A;
removed.fg = base08;
};
symbols = {
added = " ";
modified = " ";
removed = " ";
};
};
}
"branch"];
lualine_z = [
"filetype"
"fileformat"
"encoding"
];
};
theme = (lib.mapAttrs
(mode_name: mode_color: {
a = inverted;
b = inverted // { bg = mode_color; gui = "bold"; };
c = normal;
x = inverted;
y = normal;
z = inverted // { bg = mode_color; };
})
{
normal = base0D;
insert = base0B;
visual = base0F;
replace = base08;
command = base0E;
}) // {
inactive = {
a = inverted_ina;
b = normal_ina // { bg = base00; gui = "bold"; };
c = normal_ina;
x = inverted_ina;
y = normal_ina;
z = normal_ina // { bg = base00; };
};
};
};
# Show context on top if scrolled out
treesitter-context = {
enable = true;
settings.max_lines = 5;
};
web-devicons.enable = true; # TODO Check out plugins.mini.enable
};
};
};

View file

@ -1,20 +1,12 @@
{
pkgs,
lib,
config,
nixvim,
...
}:
{ pkgs, lib, config, nixvim, ... }:
{
# config = lib.mkIf config.programs.nixvim.enable { # Somehow this is infinite recursion?
config = {
home.sessionVariables =
{
EDITOR = "nvim";
}
// lib.optionalAttrs config.frogeye.desktop.xorg {
VISUAL = "nvim";
};
home.sessionVariables = {
EDITOR = "nvim";
} // lib.optionalAttrs config.frogeye.desktop.xorg {
VISUAL = "nvim";
};
programs.bash.shellAliases = {
vi = "nvim";
vim = "nvim";
@ -87,28 +79,25 @@
# Or at least something to live_grep the curent word.
# Surrounding pairs
vim-surround.enable = true; # Change surrounding pairs (e.g. brackets, quotes)
surround.enable = true; # Change surrounding pairs (e.g. brackets, quotes)
undotree.enable = true; # Navigate edition history
};
extraPlugins =
with pkgs.vimPlugins;
[
# Search/replace
vim-abolish # Regex for words, with case in mind
vim-easy-align # Aligning lines around a certain character
extraPlugins = with pkgs.vimPlugins; [
# Search/replace
vim-abolish # Regex for words, with case in mind
vim-easy-align # Aligning lines around a certain character
# Surrounding pairs
targets-vim # Better interaction with surrounding pairs
# Surrounding pairs
targets-vim # Better interaction with surrounding pairs
# Language-specific
tcomment_vim # Language-aware (un)commenting
]
++ lib.optionals config.frogeye.dev.ansible [
ansible-vim
# Doesn't generate snippets, but those are for UltiSnip anyways
];
# Language-specific
tcomment_vim # Language-aware (un)commenting
] ++ lib.optionals config.frogeye.dev.ansible [
ansible-vim
# Doesn't generate snippets, but those are for UltiSnip anyways
];
extraConfigLuaPre = lib.mkBefore ''
-- If terminal is detected to be light, background will be changed after base16 theme is applied.
-- Setting manually early to prevent hightlights having weird colors.
@ -121,9 +110,8 @@
'';
userCommands = {
Reload = {
command = "source ${config.xdg.configHome}/nvim/init.lua";
};
Reload = { command = "source ${config.xdg.configHome}/nvim/init.lua"; force = false; };
# 24.05 force=false was for https://github.com/nix-community/nixvim/issues/954
};
keymaps = [
@ -131,54 +119,24 @@
# Allow saving of files as sudo when I forgot to start vim using sudo.
# From https://stackoverflow.com/a/7078429
{
mode = "c";
key = "w!!";
action = "w !sudo tee > /dev/null %";
}
{ mode = "c"; key = "w!!"; action = "w !sudo tee > /dev/null %"; }
{
mode = "i";
key = "jk";
action = "<Esc>";
}
{
mode = "v";
key = "<Enter>";
action = "<Esc>";
}
{
key = "<Enter>";
action = "o<Esc>";
}
{ mode = "i"; key = "jk"; action = "<Esc>"; }
{ mode = "v"; key = "<Enter>"; action = "<Esc>"; }
{ key = "<Enter>"; action = "o<Esc>"; }
# { key = "<C-H>"; action = ":bp<CR>"; }
# { key = "<C-L>"; action = ":bn<CR>"; }
{
key = "<C-K>";
action = "kkkkkkkkkkkkkkkkkkkkk";
}
{
key = "<C-J>";
action = "jjjjjjjjjjjjjjjjjjjjj";
}
{ key = "<C-K>"; action = "kkkkkkkkkkkkkkkkkkkkk"; }
{ key = "<C-J>"; action = "jjjjjjjjjjjjjjjjjjjjj"; }
# \s to replace globally the word under the cursor
{
key = "<Leader>s";
action = ":%s/\\<<C-r><C-w>\\>/";
}
{ key = "<Leader>s"; action = ":%s/\\<<C-r><C-w>\\>/"; }
# PLUGINS
# undotree
{
key = "<Space>u";
action = "<Cmd>UndotreeToggle<CR>";
options = {
silent = true;
};
}
{ key = "<Space>u"; action = "<Cmd>UndotreeToggle<CR>"; options = { silent = true; }; }
];
};

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = {
programs.nixvim = {

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = {
programs.nixvim = {

View file

@ -3,23 +3,20 @@
environment.motd = "";
home-manager = {
useGlobalPkgs = true;
config =
{ ... }:
{
frogeye = config.frogeye;
home.file = {
".ssh/authorized_keys" = {
# TODO Make an option and reuse at other places
text = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPE41gxrO8oZ5n3saapSwZDViOQphm6RzqgsBUyA88pU geoffrey@frogeye.fr";
};
config = {...}: {
frogeye = config.frogeye;
home.file = {
".ssh/authorized_keys" = {
# TODO Make an option and reuse at other places
text = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPE41gxrO8oZ5n3saapSwZDViOQphm6RzqgsBUyA88pU geoffrey@frogeye.fr";
};
};
};
};
system.stateVersion = "24.05";
terminal.font = "${
pkgs.nerdfonts.override {
fonts = [ "DejaVuSansMono" ];
}
}/share/fonts/truetype/NerdFonts/DejaVuSansMNerdFont-Regular.ttf";
}}/share/fonts/truetype/NerdFonts/DejaVuSansMNerdFont-Regular.ttf";
time.timeZone = "Europe/Amsterdam";
}

View file

@ -1,14 +1,6 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
let
capitalizeFirstLetter =
str:
(lib.strings.toUpper (builtins.substring 0 1 str))
+ (builtins.substring 1 (builtins.stringLength str) str);
capitalizeFirstLetter = str: (lib.strings.toUpper (builtins.substring 0 1 str)) + (builtins.substring 1 (builtins.stringLength str) str);
in
{
options.frogeye = {
@ -20,16 +12,12 @@ in
description = "top-level flake";
type = lib.types.attrs;
};
cuda = lib.mkEnableOption "Use CUDA for some libraries";
extra = lib.mkEnableOption "Big software";
gaming = lib.mkEnableOption "Games";
polarity = lib.mkOption {
default = "light";
description = "Whether to use light theme or dark theme.";
type = lib.types.enum [
"light"
"dark"
];
type = lib.types.enum [ "light" "dark" ];
};
desktop = {
xorg = lib.mkEnableOption "Enable X11 support";
@ -46,21 +34,9 @@ in
default = 1080;
};
phasesCommands = {
jour = lib.mkOption {
type = lib.types.lines;
default = "";
description = "Command to execute for phase: jour";
};
crepuscule = lib.mkOption {
type = lib.types.lines;
default = "";
description = "Command to execute for phase: crepuscule";
};
nuit = lib.mkOption {
type = lib.types.lines;
default = "";
description = "Command to execute for phase: nuit";
};
jour = lib.mkOption { type = lib.types.lines; default = ""; description = "Command to execute for phase: jour"; };
crepuscule = lib.mkOption { type = lib.types.lines; default = ""; description = "Command to execute for phase: crepuscule"; };
nuit = lib.mkOption { type = lib.types.lines; default = ""; description = "Command to execute for phase: nuit"; };
};
};
dev = {
@ -78,90 +54,78 @@ in
};
storageSize = lib.mkOption {
default = "small";
type = lib.types.enum [
"small"
"big"
"phone"
];
type = lib.types.enum [ "small" "big" "phone" ];
description = "Type of storage for the device. Used to determine which folder to include.";
};
folders = lib.mkOption {
default = { };
description = "Folders used by users";
# Top-level so Syncthing can work for all users. Also there's no real home-manager syncthing module.
type = lib.types.attrsOf (
lib.types.submodule (
{ config, name, ... }:
{
options = {
name = lib.mkOption {
type = lib.types.str;
default = name;
readOnly = true;
internal = true;
description = "Name accessing this entry";
type = lib.types.attrsOf (lib.types.submodule ({ config, name, ... }: {
options = {
name = lib.mkOption {
type = lib.types.str;
default = name;
readOnly = true;
internal = true;
description = "Name accessing this entry";
};
enable = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Whether to use this folder.";
};
path = lib.mkOption {
type = lib.types.str;
description = "Path relative to HOME. Prefer French names which has more varied initials, easing navigation.";
};
label = lib.mkOption {
type = lib.types.str;
description = "Friendly name";
default = capitalizeFirstLetter config.path;
};
user = lib.mkOption {
type = lib.types.str;
default = "geoffrey";
description = "User using this directory.";
};
fullPath = lib.mkOption {
type = lib.types.str;
default = "/home/${config.user}/${config.path}";
# Hardcoded due to outside of any user context
description = "Absolute path.";
};
xdgUserDirVariable = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = if config.enable then "XDG_${lib.strings.toUpper name}_DIR" else null;
description = "Name for the XDG user dir variable. If set, will automatically create the directory.";
};
syncthing = lib.mkOption {
default = { };
description = "Syncthing configuration for the folder";
type = lib.types.submodule ({ ... }: {
freeformType = (pkgs.formats.json { }).type;
options = {
enable = lib.mkOption {
type = lib.types.bool;
default = config.enable && config.syncthing.id != null;
description = "Whether to sync.";
};
id = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = "Syncthing folder id";
};
};
enable = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Whether to use this folder.";
};
path = lib.mkOption {
type = lib.types.str;
description = "Path relative to HOME. Prefer French names which has more varied initials, easing navigation.";
};
label = lib.mkOption {
type = lib.types.str;
description = "Friendly name";
default = capitalizeFirstLetter config.path;
};
user = lib.mkOption {
type = lib.types.str;
default = "geoffrey";
description = "User using this directory.";
};
fullPath = lib.mkOption {
type = lib.types.str;
default = "/home/${config.user}/${config.path}";
# Hardcoded due to outside of any user context
description = "Absolute path.";
};
xdgUserDirVariable = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = if config.enable then "XDG_${lib.strings.toUpper name}_DIR" else null;
description = "Name for the XDG user dir variable. If set, will automatically create the directory.";
};
syncthing = lib.mkOption {
default = { };
description = "Syncthing configuration for the folder";
type = lib.types.submodule (
{ ... }:
{
freeformType = (pkgs.formats.json { }).type;
options = {
enable = lib.mkOption {
type = lib.types.bool;
default = config.enable && config.syncthing.id != null;
description = "Whether to sync.";
};
id = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = "Syncthing folder id";
};
};
}
);
};
versionsMaxDays = lib.mkOption {
type = lib.types.nullOr lib.types.int;
default = 365;
description = "For big systems, how many days of staggered versions should be kept";
};
};
}
)
);
});
};
versionsMaxDays = lib.mkOption {
type = lib.types.nullOr lib.types.int;
default = 365;
description = "For big systems, how many days of staggered versions should be kept";
};
};
}));
};
hooks.lock = lib.mkOption {
type = lib.types.lines;

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
boot.loader = {
grub = {
@ -15,3 +10,4 @@
};
}

View file

@ -6,12 +6,10 @@
eap=TTLS
identity="37C3"
password="37C3"
ca_cert="${
builtins.fetchurl {
url = "https://letsencrypt.org/certs/isrgrootx1.pem";
sha256 = "sha256:1la36n2f31j9s03v847ig6ny9lr875q3g7smnq33dcsmf2i5gd92";
}
}"
ca_cert="${builtins.fetchurl {
url = "https://letsencrypt.org/certs/isrgrootx1.pem";
sha256 = "sha256:1la36n2f31j9s03v847ig6ny9lr875q3g7smnq33dcsmf2i5gd92";
}}"
altsubject_match="DNS:radius.c3noc.net"
phase2="auth=PAP"
'';

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
networking = {
hostName = config.frogeye.name;
@ -21,17 +16,13 @@
# Enable passwordless sudo
# TODO execWheelOnly? sudo-rs?
security.sudo.extraRules = [
{
groups = [ "wheel" ];
commands = [
{
command = "ALL";
options = [ "NOPASSWD" ];
}
];
}
];
security.sudo.extraRules = [{
groups = [ "wheel" ];
commands = [{
command = "ALL";
options = [ "NOPASSWD" ];
}];
}];
# UPST disko --root-mountpoint doesn't work when using flake, workaround:
disko.rootMountPoint = "/mnt/nixos";
@ -53,10 +44,7 @@
nix = {
package = pkgs.lix;
settings = {
experimental-features = [
"nix-command"
"flakes"
];
experimental-features = [ "nix-command" "flakes" ];
warn-dirty = false;
};
};

View file

@ -1,39 +0,0 @@
# Need nvidia proprietary drivers to work
{
pkgs,
nixpkgs,
config,
lib,
...
}:
{
config = lib.mkIf config.frogeye.cuda {
nix.settings = {
substituters = [
"https://cuda-maintainers.cachix.org"
];
trusted-public-keys = [
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
];
};
nixpkgs.overlays = [
(
self: super:
let
pkgs_uf = import nixpkgs {
inherit (super) system;
config.allowUnfree = true;
};
in
{
ctranslate2 = (
pkgs_uf.ctranslate2.override {
withCUDA = true;
withCuDNN = true;
}
);
}
)
];
};
}

View file

@ -6,7 +6,6 @@
./battery.nix
./boot
./ccc
./cuda
./common.nix
./desktop
./dev

View file

@ -1,19 +1,12 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
let
setupScript = "${
pkgs.writeShellApplication {
name = "greeter-setup-script";
runtimeInputs = [ pkgs.autorandr ];
text = ''
autorandr --change
'';
}
}/bin/greeter-setup-script";
setupScript = "${pkgs.writeShellApplication {
name = "greeter-setup-script";
runtimeInputs = [ pkgs.autorandr ];
text = ''
autorandr --change
'';
}}/bin/greeter-setup-script";
in
{
config = {

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = lib.mkIf config.frogeye.desktop.xorg {
boot.kernelModules = [ "i2c-dev" ]; # Allows using ddcutil
@ -24,7 +19,7 @@
# https://wiki.archlinux.org/title/PipeWire#Noticeable_audio_delay_or_audible_pop/crack_when_starting_playback
preventGetTogetherDuoFromShuttingDown."monitor.bluez.rules" = [
{
matches = [ { "node.name" = "~bluez_output.41_42_D2_B5_13_72.*"; } ];
matches = [{ "node.name" = "~bluez_output.41_42_D2_B5_13_72.*"; }];
actions.update-props = {
"session.suspend-timeout-seconds" = 0;
"dither.method" = "wannamaker3";
@ -44,25 +39,23 @@
extraLayouts.qwerty-fr = {
description = "QWERTY-fr";
languages = [ "fr" ];
symbolsFile = "${
pkgs.stdenv.mkDerivation {
name = "qwerty-fr-keypad";
src = pkgs.fetchFromGitHub {
owner = "qwerty-fr";
repo = "qwerty-fr";
rev = "3a4d13089e8ef016aa20baf6b2bf3ea53de674b8";
sha256 = "sha256-wn5n6jJVDrQWJze8xYF2nEY8a7mHI3hVO4xsT4LMo9c=";
};
patches = [ ./qwerty-fr-keypad.diff ];
# TODO This doesn't seem to be applied... it's the whole point of the derivation :(
installPhase = ''
runHook preInstall
mkdir -p $out/linux
cp $src/linux/us_qwerty-fr $out/linux
runHook postInstall
'';
}
}/linux/us_qwerty-fr";
symbolsFile = "${pkgs.stdenv.mkDerivation {
name = "qwerty-fr-keypad";
src = pkgs.fetchFromGitHub {
owner = "qwerty-fr";
repo = "qwerty-fr";
rev = "3a4d13089e8ef016aa20baf6b2bf3ea53de674b8";
sha256 = "sha256-wn5n6jJVDrQWJze8xYF2nEY8a7mHI3hVO4xsT4LMo9c=";
};
patches = [ ./qwerty-fr-keypad.diff ];
# TODO This doesn't seem to be applied... it's the whole point of the derivation :(
installPhase = ''
runHook preInstall
mkdir -p $out/linux
cp $src/linux/us_qwerty-fr $out/linux
runHook postInstall
'';
}}/linux/us_qwerty-fr";
};
layout = "qwerty-fr";
};

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = lib.mkMerge [
(lib.mkIf config.frogeye.dev.docker {

View file

@ -1,33 +1,29 @@
{ pkgs, lib, config, ... }:
{
pkgs,
lib,
config,
...
}:
{
config = lib.mkIf config.frogeye.gaming {
programs.steam.enable = true;
hardware.graphics.enable32Bit = true; # Needed by Steam
services = {
udev.packages = [ pkgs.python3Packages.ds4drv ];
xserver.config = ''
# Disable mouse support for joypad
Section "InputClass"
Identifier "joystick catchall"
MatchIsJoystick "on"
MatchDevicePath "/dev/input/event*"
Driver "joystick"
Option "StartKeysEnabled" "False"
Option "StartMouseEnabled" "False"
EndSection
# Same thing for DualShock 4 touchpad
Section "InputClass"
Identifier "ds4-touchpad"
Driver "libinput"
MatchProduct "Wireless Controller Touchpad"
Option "Ignore" "True"
EndSection
'';
config = lib.mkIf config.frogeye.gaming
{
programs.steam.enable = true;
hardware.opengl.driSupport32Bit = true; # Enables support for 32bit libs that steam uses
services = {
udev.packages = [ pkgs.python3Packages.ds4drv ];
xserver.config = ''
# Disable mouse support for joypad
Section "InputClass"
Identifier "joystick catchall"
MatchIsJoystick "on"
MatchDevicePath "/dev/input/event*"
Driver "joystick"
Option "StartKeysEnabled" "False"
Option "StartMouseEnabled" "False"
EndSection
# Same thing for DualShock 4 touchpad
Section "InputClass"
Identifier "ds4-touchpad"
Driver "libinput"
MatchProduct "Wireless Controller Touchpad"
Option "Ignore" "True"
EndSection
'';
};
};
};
}

View file

@ -1,20 +1,11 @@
{
pkgs,
lib,
config,
home-manager,
...
}:
{ pkgs, lib, config, home-manager, ... }:
{
config = {
users.users.root.initialHashedPassword = "$y$j9T$e64bjL7iyVlniEKwKbM9g0$cCn74za0r6L9QMO20Fdxz3/SX0yvhz3Xd6.2BhtbRL1"; # Not a real password
users.users.geoffrey = {
isNormalUser = true;
extraGroups = [
"adbusers"
"wheel"
];
extraGroups = [ "adbusers" "wheel" ];
shell = pkgs.zsh;
initialHashedPassword = "$y$j9T$e64bjL7iyVlniEKwKbM9g0$cCn74za0r6L9QMO20Fdxz3/SX0yvhz3Xd6.2BhtbRL1"; # Not a real password
@ -30,13 +21,11 @@
nix.settings.trusted-users = [ "geoffrey" ];
home-manager = {
users.geoffrey =
{ pkgs, ... }:
{
frogeye = lib.mkDefault config.frogeye;
# Propagating options that way doesn't seem to conserve priority info,
# this is not great. Hopefully mkDefault resolve conflicts.
};
users.geoffrey = { pkgs, ... }: {
frogeye = lib.mkDefault config.frogeye;
# Propagating options that way doesn't seem to conserve priority info,
# this is not great. Hopefully mkDefault resolve conflicts.
};
# Makes VMs able to re-run
useUserPackages = true;
# Adds consistency

View file

@ -1,18 +1,9 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
let
passwordStoreDir = "/etc/passwords";
passwordHash =
password:
builtins.hashString "sha256" "${password.path}\n${builtins.toString password.selector}\n${builtins.toString password.transform}";
passwordHash = password: builtins.hashString "sha256" "${password.path}\n${builtins.toString password.selector}\n${builtins.toString password.transform}";
passwordStorePath = password: "${passwordStoreDir}/${passwordHash password}";
describePassword =
password:
password.path
describePassword = password: password.path
+ (if password.selector != null then " -> ${password.selector}" else "")
+ (if password.transform != null then " | (${password.transform})" else "");
passwordFiles = builtins.attrValues config.vivarium.passwordFiles;
@ -21,23 +12,16 @@ in
config = {
system = {
activationScripts.secrets = {
deps = [
"users"
"groups"
];
deps = [ "users" "groups" ];
supportsDryActivation = false; # TODO
text =
let
readPassword = password: "cat ${lib.strings.escapeShellArg (passwordStorePath password)}";
# Using awk's ENVIRON so it should resist any input?
pipeSubstitute =
k: v:
''K=${lib.strings.escapeShellArg k} V="$(${v})" awk '{ gsub (ENVIRON["K"], ENVIRON["V"]); print }' '';
pipeSubstitute = k: v: ''K=${lib.strings.escapeShellArg k} V="$(${v})" awk '{ gsub (ENVIRON["K"], ENVIRON["V"]); print }' '';
subsitutePassword = variable: password: pipeSubstitute variable (readPassword password);
subsitutePasswordFile = passwordFile: lib.mapAttrsToList subsitutePassword passwordFile.passwords;
renderPasswordFile =
passwordFile:
"${lib.strings.concatStringsSep "| " (subsitutePasswordFile passwordFile)} < ${passwordFile.template}";
renderPasswordFile = passwordFile: "${lib.strings.concatStringsSep "| " (subsitutePasswordFile passwordFile)} < ${passwordFile.template}";
installPasswordFile = passwordFile: ''
install -C -o ${passwordFile.owner} -g ${passwordFile.group} -m ${passwordFile.mode} -d ${builtins.dirOf passwordFile.path}
temp="$(mktemp)"
@ -47,15 +31,12 @@ in
rm "$temp"
trap - ERR
'';
installPasswordFileApp =
passwordFile:
pkgs.writeShellApplication {
name = builtins.replaceStrings [ "/" ] [ "_" ] passwordFile.path;
runtimeInputs = with pkgs; [ gawk ];
text = installPasswordFile passwordFile;
};
installPasswordFileSandboxed =
passwordFile:
installPasswordFileApp = passwordFile: pkgs.writeShellApplication {
name = builtins.replaceStrings ["/"] ["_"] passwordFile.path;
runtimeInputs = with pkgs; [ gawk ];
text = installPasswordFile passwordFile;
};
installPasswordFileSandboxed = passwordFile:
''${lib.getExe (installPasswordFileApp passwordFile)} || echo Failed to install ${lib.strings.escapeShellArg passwordFile.path}'';
in
''
@ -66,38 +47,22 @@ in
extraSystemBuilderCmds =
let
passwords = builtins.attrValues config.vivarium.passwords;
readPasswordClear =
password:
"pass show ${lib.strings.escapeShellArg password.path}"
+ (
if password.selector == null then
" | head -n1"
else
(if password.selector == "@" then "" else " | tail -n +2 | yq -r '.${password.selector}'")
);
readPassword =
password:
(readPasswordClear password)
+ (lib.strings.optionalString (password.transform != null) " | ${password.transform}");
readPasswordClear = password: "pass show ${lib.strings.escapeShellArg password.path}" + (
if password.selector == null
then " | head -n1"
else
(if password.selector == "@"
then ""
else " | tail -n +2 | yq -r '.${password.selector}'")
);
readPassword = password: (readPasswordClear password) + (lib.strings.optionalString (password.transform != null) " | ${password.transform}");
gitPath = password: ''"$PASSWORD_STORE_DIR"/${lib.strings.escapeShellArg password.path}.gpg'';
isGeneratedPassword = password: ''test -f ${gitPath password}'';
dateGit =
password:
" "
+ ''(cd "$(dirname ${gitPath password})"; git log -n1 --format='format:%ct' "$(basename ${gitPath password})")''
+ " ";
dateGit = password: " " + ''(cd "$(dirname ${gitPath password})"; git log -n1 --format='format:%ct' "$(basename ${gitPath password})")'' + " ";
dateStore = password: ''sudo stat -c '%Y' ${passwordStorePath password}'';
isInStore = password: ''sudo test -f ${passwordStorePath password}'';
testCanGenerate =
password:
lib.asserts.assertMsg (builtins.elem password.selector [
"@"
null
]) "Unimplemented: generator + selector ${describePassword password}";
generatePassword =
password:
assert testCanGenerate password;
''${password.generator} | pass insert -m ${lib.strings.escapeShellArg password.path}'';
testCanGenerate = password: lib.asserts.assertMsg (builtins.elem password.selector [ "@" null ]) "Unimplemented: generator + selector ${describePassword password}";
generatePassword = password: assert testCanGenerate password; ''${password.generator} | pass insert -m ${lib.strings.escapeShellArg password.path}'';
raiseCantGenerate = password: ''echo "Error: no generator" ; exit 1'';
syncPasswordStore = password: ''
# ${describePassword password}
@ -147,27 +112,23 @@ in
allFilenames = builtins.map (password: "${passwordStoreDir}/${passwordHash password}") passwords;
in
''
ln -s ${
lib.getExe (
pkgs.writeShellApplication {
name = "update-password-store";
text = ''
test -d "$PASSWORD_STORE_DIR"
sudo install -C -o root -g root -m u=rwx -d "${passwordStoreDir}"
ln -s ${lib.getExe (pkgs.writeShellApplication {
name = "update-password-store";
text = ''
test -d "$PASSWORD_STORE_DIR"
sudo install -C -o root -g root -m u=rwx -d "${passwordStoreDir}"
${lib.strings.concatLines (builtins.map syncPasswordStore passwords)}
${lib.strings.concatLines (builtins.map syncPasswordStore passwords)}
comm -23 <(sudo find ${passwordStoreDir} -type f -ctime +60 | sort) <(echo ${lib.strings.escapeShellArg (lib.strings.concatLines allFilenames)} | sort) | while read -r file
do
echo Removing "$file" from password store
sudo rm "$file"
done
'';
# -ctime +60 is so it is possible to boot from previous nixpkgs without missing transform hashes
# TODO Find a better mechanism, maybe à la bootspec, or something compatible with cross-arch
}
)
} $out/bin/
comm -23 <(sudo find ${passwordStoreDir} -type f -ctime +60 | sort) <(echo ${lib.strings.escapeShellArg (lib.strings.concatLines allFilenames)} | sort) | while read -r file
do
echo Removing "$file" from password store
sudo rm "$file"
done
'';
# -ctime +60 is so it is possible to boot from previous nixpkgs without missing transform hashes
# TODO Find a better mechanism, maybe à la bootspec, or something compatible with cross-arch
})} $out/bin/
'';
};
vivarium.passwords =
@ -183,89 +144,82 @@ in
vivarium =
let
defaultvar = "@PASSWORD@";
passwordSubmodule = lib.types.submodule (
{ ... }:
{
options = {
path = lib.mkOption {
type = lib.types.str;
description = "Path to the password store entry";
};
selector = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = "If unset, selects the first line. If '@', select everything. If any other value, will parse the password metadata as YML and use selector (yq).";
};
generator = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = "${lib.getExe pkgs.pwgen} -s 32";
description = "Command to generate the password. Won't work when selector is set to read metadata.";
};
transform = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = "Shell command to transform the password with before substitution";
};
passwordSubmodule = lib.types.submodule ({ ... }: {
options = {
path = lib.mkOption {
type = lib.types.str;
description = "Path to the password store entry";
};
}
);
selector = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = "If unset, selects the first line. If '@', select everything. If any other value, will parse the password metadata as YML and use selector (yq).";
};
generator = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = "${lib.getExe pkgs.pwgen} -s 32";
description = "Command to generate the password. Won't work when selector is set to read metadata.";
};
transform = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = "Shell command to transform the password with before substitution";
};
};
});
in
{
passwords = lib.mkOption {
default = { };
type = lib.types.attrsOf passwordSubmodule;
};
passwordFiles = lib.mkOption {
default = { };
type = lib.types.attrsOf (
lib.types.submodule (
{ name, config, ... }:
{
options = {
path = lib.mkOption {
type = lib.types.str;
default = name;
description = "Where to place the file.";
};
mode = lib.mkOption {
type = lib.types.str;
default = "0400";
description = "Unix permission";
};
owner = lib.mkOption {
type = lib.types.str;
default = "root";
description = "Owner of the secret file";
};
group = lib.mkOption {
type = lib.types.str;
default = "root";
description = "Group of the secret file";
};
text = lib.mkOption {
type = lib.types.str;
default = defaultvar;
description = "Content of the template used to make the file. Exclusive with `template`.";
};
template = lib.mkOption {
type = lib.types.path;
default = pkgs.writeText "password-template" config.text;
description = "Content of the template used to make the file. Exclusive with `text`.";
};
passwords = lib.mkOption {
default = lib.optionalAttrs (config.password != null) { ${defaultvar} = config.password; };
type = lib.types.attrsOf passwordSubmodule;
description = "Paths to passwords that will substitute the variables in the template. Exclusive with `password`";
};
password = lib.mkOption {
type = passwordSubmodule;
description = "Path to password that will substitute '@PASSWORD@' in the template. Exclusive with `passwords`.";
};
passwordFiles =
lib.mkOption {
default = { };
type = lib.types.attrsOf (lib.types.submodule ({ name, config, ... }: {
options = {
path = lib.mkOption {
type = lib.types.str;
default = name;
description = "Where to place the file.";
};
}
)
);
};
mode = lib.mkOption {
type = lib.types.str;
default = "0400";
description = "Unix permission";
};
owner = lib.mkOption {
type = lib.types.str;
default = "root";
description = "Owner of the secret file";
};
group = lib.mkOption {
type = lib.types.str;
default = "root";
description = "Group of the secret file";
};
text = lib.mkOption {
type = lib.types.str;
default = defaultvar;
description = "Content of the template used to make the file. Exclusive with `template`.";
};
template = lib.mkOption {
type = lib.types.path;
default = pkgs.writeText "password-template" config.text;
description = "Content of the template used to make the file. Exclusive with `text`.";
};
passwords = lib.mkOption {
default = lib.optionalAttrs (config.password != null) { ${defaultvar} = config.password; };
type = lib.types.attrsOf passwordSubmodule;
description = "Paths to passwords that will substitute the variables in the template. Exclusive with `password`";
};
password = lib.mkOption {
type = passwordSubmodule;
description = "Path to password that will substitute '@PASSWORD@' in the template. Exclusive with `passwords`.";
};
};
}));
};
};
};
}

View file

@ -1,15 +1,7 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
let
vivariumBuilderDefault = {
systems = [
"x86_64-linux"
"aarch64-linux"
];
systems = [ "x86_64-linux" "aarch64-linux" ];
protocol = "ssh-ng";
sshUser = "nixremote";
# sshKey doesn't work
@ -19,12 +11,7 @@ let
{
hostName = "abavorana.frogeye.fr";
publicHostKey = "c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSU5iNzcrS01tRHI0MVhZdmZITXQvK3NHMkJCSEIzYUl4M045WDNVejhFaUogZ2VvZmZyZXlAY3VyYWNhbwo=";
supportedFeatures = [
"nixos-test"
"benchmark"
"big-parallel"
"kvm"
];
supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
maxJobs = 8;
}
{
@ -45,31 +32,21 @@ in
supportsDryActivation = true;
text = ''
mkdir -p /root/.ssh
cat ${
pkgs.writeText "root-ssh-config" (
lib.strings.concatLines (
builtins.map (builder: ''
Host ${builder.hostName}
ControlMaster auto
ControlPath ~/.ssh/master-%r@%n:%p
ControlPersist 60s
'') vivariumBuilders
)
)
} > /root/.ssh/config
cat ${pkgs.writeText "root-ssh-config" (lib.strings.concatLines (builtins.map (builder: ''
Host ${builder.hostName}
ControlMaster auto
ControlPath ~/.ssh/master-%r@%n:%p
ControlPersist 60s
'') vivariumBuilders)) } > /root/.ssh/config
'';
};
nix = {
buildMachines = builtins.map (
vivariumBuilder: vivariumBuilderDefault // vivariumBuilder
) vivariumBuilders;
buildMachines = builtins.map (vivariumBuilder: vivariumBuilderDefault // vivariumBuilder) vivariumBuilders;
distributedBuilds = false;
settings = {
builders-use-substitutes = true;
trusted-public-keys = publicKeys;
trusted-substituters = builtins.map (
builder: "${builder.protocol}://${builder.sshUser}@${builder.hostName}"
) config.nix.buildMachines;
trusted-substituters = builtins.map (builder: "${builder.protocol}://${builder.sshUser}@${builder.hostName}") config.nix.buildMachines;
};
};
};

View file

@ -1,10 +1,4 @@
{
pkgs,
lib,
config,
stylix,
...
}:
{ pkgs, lib, config, stylix, ... }:
{
config = {
boot = {
@ -12,17 +6,13 @@
initrd.systemd.enable = true;
};
stylix = {
enable = true;
enable = true;
homeManagerIntegration.autoImport = false; # Makes config reuse easier
polarity = "dark";
targets.plymouth.logo =
pkgs.runCommand "flower.png" { }
"${pkgs.inkscape}/bin/inkscape ${
pkgs.substituteAll {
src = ./flower.svg;
color = config.lib.stylix.colors.withHashtag.base07;
}
} -w 256 -o $out";
targets.plymouth.logo = pkgs.runCommand "flower.png" { } "${pkgs.inkscape}/bin/inkscape ${pkgs.substituteAll {
src = ./flower.svg;
color = config.lib.stylix.colors.withHashtag.base07;
}} -w 256 -o $out";
# UPST Default grub font is sansSerif, which doesn't work.
# Maybe because people patch mono with nerdfonts and that isn't compatible?
};

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
let
cfg = config.services.syncthing;
service = "syncthing";
@ -14,14 +9,9 @@ let
generator = ''(t="$(mktemp -d)" && ${lib.getExe pkgs.syncthing} generate --home="$t" &> /dev/null && cat "$t"/{cert,key}.pem && rm -rf "$t")'';
};
capitalizeFirstLetter =
str:
(lib.strings.toUpper (builtins.substring 0 1 str))
+ (builtins.substring 1 (builtins.stringLength str) str);
capitalizeFirstLetter = str: (lib.strings.toUpper (builtins.substring 0 1 str)) + (builtins.substring 1 (builtins.stringLength str) str);
nixosDevices = builtins.map (system: system.config.frogeye) (
builtins.attrValues config.frogeye.toplevel.nixosConfigurations
);
nixosDevices = builtins.map (system: system.config.frogeye) (builtins.attrValues config.frogeye.toplevel.nixosConfigurations);
allDevices = nixosDevices;
syncingDevices = builtins.filter (device: device.syncthing.id != null) allDevices;
peerDevices = builtins.filter (device: device.name != config.frogeye.name) syncingDevices;
@ -30,10 +20,7 @@ let
allFolders = builtins.attrValues config.frogeye.folders;
syncedFolders = builtins.filter (folder: folder.syncthing.enable) allFolders;
folderShouldSyncWith =
folder: device:
(lib.hasAttrByPath [ folder.name ] device.folders)
&& device.folders.${folder.name}.syncthing.enable;
folderShouldSyncWith = folder: device: (lib.hasAttrByPath [ folder.name ] device.folders) && device.folders.${folder.name}.syncthing.enable;
folderDeviceEntry = folder: device: { deviceID = device.syncthing.id; };
enable = (builtins.length syncedFolders) > 0;
@ -51,38 +38,29 @@ in
cert = "${secretsDir}/cert.pem";
settings = {
devices = builtins.listToAttrs (
builtins.map (device: {
inherit (device) name;
value = device.syncthing;
}) syncingDevices
);
folders = builtins.listToAttrs (
builtins.map (folder: {
devices = builtins.listToAttrs (builtins.map (device: { inherit (device) name; value = device.syncthing; }) syncingDevices);
folders = builtins.listToAttrs (builtins.map
(folder: {
inherit (folder) name;
value = {
label = "${capitalizeFirstLetter folder.user} ${folder.label}";
path = "${config.users.users.${folder.user}.home}/${folder.path}";
# Despite further in the code indicating this is possible, it is, actually not
# devices = builtins.map (folderDeviceEntry folder) (builtins.filter (folderShouldSyncWith folder) peerDevices);
devices = builtins.map (device: device.name) (
builtins.filter (folderShouldSyncWith folder) peerDevices
);
versioning =
if (config.frogeye.storageSize == "big" && folder.versionsMaxDays != null) then
{
value =
{
label = "${capitalizeFirstLetter folder.user} ${folder.label}";
path = "${config.users.users.${folder.user}.home}/${folder.path}";
# Despite further in the code indicating this is possible, it is, actually not
# devices = builtins.map (folderDeviceEntry folder) (builtins.filter (folderShouldSyncWith folder) peerDevices);
devices = builtins.map (device: device.name) (builtins.filter (folderShouldSyncWith folder) peerDevices);
versioning =
if (config.frogeye.storageSize == "big" && folder.versionsMaxDays != null) then {
type = "staggered";
params.maxAge = builtins.toString (folder.versionsMaxDays * 24 * 3600);
# TODO Increase cleanupIntervalS to 1 day or so
}
else
null;
rescanIntervalS = 10 * 3600; # Using watcher, should be good enough
copyRangeMethod = "all"; # Prevents duplication
copyOwnershipFromParent = true;
} // folder.syncthing;
}) syncedFolders
);
} else null;
rescanIntervalS = 10 * 3600; # Using watcher, should be good enough
copyRangeMethod = "all"; # Prevents duplication
copyOwnershipFromParent = true;
} // folder.syncthing;
})
syncedFolders);
options = rec {
urAccepted = 3;
urSeen = urAccepted;
@ -97,11 +75,7 @@ in
''}"
];
PrivateUsers = lib.mkForce false;
AmbientCapabilities = [
"CAP_CHOWN"
"CAP_DAC_OVERRIDE"
"CAP_FOWNER"
];
AmbientCapabilities = ["CAP_CHOWN" "CAP_DAC_OVERRIDE" "CAP_FOWNER"];
};
vivarium.passwordFiles = {
${cfg.key}.password = password // {

View file

@ -1,23 +1,17 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
let
importScript = pkgs.writers.writePython3 "install-wifi-import" {
libraries = [ pkgs.python3Packages.pyaml ];
} (builtins.readFile ./import.py);
importScript = pkgs.writers.writePython3 "install-wifi-import"
{
libraries = [ pkgs.python3Packages.pyaml ];
}
(builtins.readFile ./import.py);
applyScript = pkgs.writers.writePython3 "install-wifi-apply" { } (builtins.readFile ./apply.py);
in
{
environment.systemPackages = [
(pkgs.writeShellApplication {
name = "install-wifi";
runtimeInputs = with pkgs; [
wpa_supplicant
diffutils
];
runtimeInputs = with pkgs; [ wpa_supplicant diffutils ];
text = ''
temp="$(mktemp --directory --suffix="-install-wifi")"
cd "$temp"
@ -53,45 +47,32 @@ in
})
];
# wireless support via wpa_supplicant
networking = {
# Tell the time synchronisation service when we got/lost the connection
dhcpcd.runHook = ''
if $if_up; then
${config.services.chrony.package}/bin/chronyc online
elif $if_down; then
${config.services.chrony.package}/bin/chronyc offline
fi
networking.wireless = {
enable = true;
extraConfig = ''
country=NL
'';
wireless = {
enable = true;
extraConfig = ''
country=NL
'';
# Public wireless networks
networks = lib.genAttrs [
"EurostarTrainsWiFi"
"_SNCF gare-gratuit"
"_SNCF_WIFI_INOUI"
"Wifi in de trein"
"WiFi in de trein"
"_WIFI_LYRIA"
"WIFIonICE"
] (ssid: { });
userControlled.enable = true; # Allow some control with wpa_cli
};
# Public wireless networks
networks = lib.genAttrs [
"EurostarTrainsWiFi"
"_SNCF gare-gratuit"
"_SNCF_WIFI_INOUI"
"Wifi in de trein"
"WiFi in de trein"
"_WIFI_LYRIA"
"WIFIonICE"
]
(ssid: { });
userControlled.enable = true; # Allow some control with wpa_cli
};
# Wait until there's a connection to fetch time
services.chrony.serverOption = "offline";
systemd.services.wifi_apply = {
after = [ "wpa_supplicant.service" ];
wantedBy = [ "wpa_supplicant.service" ];
path = with pkgs; [ wpa_supplicant ];
script = ''
for i in {1..50}; do wpa_cli status &> /dev/null && break; sleep 0.1; done
${applyScript}
for i in {1..50}; do wpa_cli status &> /dev/null && break; sleep 0.1; done
${applyScript}
'';
};
}

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = {
disko.devices.disk."${config.frogeye.name}".device = "/dev/disk/by-id/mmc-DA4064_0x931f080f";

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = {
frogeye = {

View file

@ -1,10 +1,4 @@
{
pkgs,
lib,
config,
nixos-hardware,
...
}:
{ pkgs, lib, config, nixos-hardware, ... }:
{
config = {
boot = {
@ -16,10 +10,7 @@
};
frogeye.desktop = {
x11_screens = [
"DP-1"
"eDP-1"
];
x11_screens = [ "DP-1" "eDP-1" ];
maxVideoHeight = 1080;
phasesCommands = {
jour = ''
@ -39,12 +30,10 @@
# https://wiki.pine64.org/wiki/Mainline_Hardware_Decoding#mpv
# Might be worth if using CI to build.
home-manager.sharedModules = [
{
# gpu-hq is too much for it to handle, even with hw decoding
config.programs.mpv.config.profile = lib.mkForce "default";
}
];
home-manager.sharedModules = [{
# gpu-hq is too much for it to handle, even with hw decoding
config.programs.mpv.config.profile = lib.mkForce "default";
}];
zramSwap = {
# Not capable of building itself otherwise

View file

@ -1,9 +1,4 @@
{
pkgs,
lib,
config,
...
}:
{ pkgs, lib, config, ... }:
{
config = {
boot.loader.efi.canTouchEfiVariables = false;