Compare commits

..

1 commit

Author SHA1 Message Date
5f9c60bd63 flake.lock: Update
All checks were successful
/ test (push) Successful in 11m40s
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/e55f9a8678adc02024a4877c2a403e3f6daf24fe' (2024-09-03)
  → 'github:nix-community/disko/a31fe5ef162f2f963308289e6e27d37e3948a983' (2024-09-19)
• Updated input 'dream2nix':
    'github:nix-community/dream2nix/3fd4c14d3683baac8d1f94286ae14fe160888b51' (2024-08-01)
  → 'github:nix-community/dream2nix/b76c529f377100516c40c5b6e239a4525fdcabe0' (2024-09-16)
• Updated input 'flakeParts':
    'github:hercules-ci/flake-parts/567b938d64d4b4112ee253b9274472dc3a346eb6' (2024-09-01)
  → 'github:hercules-ci/flake-parts/bcef6817a8b2aa20a5a6dbb19b43e63c5bf8619a' (2024-09-12)
• Updated input 'homeManager':
    'github:nix-community/home-manager/be47a2bdf278c57c2d05e747a13ed31cef54a037' (2024-09-09)
  → 'github:nix-community/home-manager/7578176649a08abb73dfbd2755a5988766952b53' (2024-09-19)
• Updated input 'lix':
    'git+https://git@git.lix.systems/lix-project/lix?ref=refs/heads/main&rev=c14486ae8d3bbc862c625d948a6b2f4dc0927d5b' (2024-09-09)
  → 'git+https://git@git.lix.systems/lix-project/lix?ref=refs/heads/main&rev=79246a37337c5df2224dbc2461c722e1e678f6de' (2024-09-18)
• Updated input 'lix-module':
    'git+https://git.lix.systems/lix-project/nixos-module?ref=refs/heads/main&rev=353b25f0b6da5ede15206d416345a2ec4195b5c8' (2024-09-08)
  → 'git+https://git.lix.systems/lix-project/nixos-module?ref=refs/heads/main&rev=b0e6f359500d66670cc16f521e4f62d6a0a4864e' (2024-09-18)
• Updated input 'lix-module/flake-utils':
    'github:numtide/flake-utils/b1d9ab70662946ef0850d488da1c9019f3a9752a' (2024-03-11)
  → 'github:numtide/flake-utils/c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a' (2024-09-17)
• Updated input 'nixDarwin':
    'github:LnL7/nix-darwin/76559183801030451e200c90a1627c1d82bb4910' (2024-09-06)
  → 'github:LnL7/nix-darwin/c03f85fa42d68d1056ca1740f3113b04f3addff2' (2024-09-19)
• Updated input 'nixosHardware':
    'github:NixOS/nixos-hardware/166dee4f88a7e3ba1b7a243edb1aca822f00680e' (2024-09-09)
  → 'github:NixOS/nixos-hardware/10d5e0ecc32984c1bf1a9a46586be3451c42fd94' (2024-09-19)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/268bb5090a3c6ac5e1615b38542a868b52ef8088' (2024-09-19)
  → 'github:NixOS/nixpkgs/78fdf431cdf6bc4ba4af9c100aaeda65da7e4ed3' (2024-09-19)
• Updated input 'pre-commit-hooks':
    'github:cachix/pre-commit-hooks.nix/7570de7b9b504cfe92025dd1be797bf546f66528' (2024-09-05)
  → 'github:cachix/pre-commit-hooks.nix/4e743a6920eab45e8ba0fbe49dc459f1423a4b74' (2024-09-19)
• Updated input 'pre-commit-hooks/nixpkgs-stable':
    'github:NixOS/nixpkgs/086b448a5d54fd117f4dc2dee55c9f0ff461bdc1' (2024-09-16)
  → 'github:NixOS/nixpkgs/194846768975b7ad2c4988bdb82572c00222c0d7' (2024-07-07)
• Updated input 'treefmt-nix':
    'github:numtide/treefmt-nix/9fb342d14b69aefdf46187f6bb80a4a0d97007cd' (2024-09-02)
  → 'github:numtide/treefmt-nix/ee41a466c2255a3abe6bc50fc6be927cdee57a9f' (2024-09-19)
2024-09-19 15:09:03 +00:00
169 changed files with 2315 additions and 3062 deletions

View file

@ -3,35 +3,28 @@
self, self,
lib, lib,
... ...
}: }: {
{
imports = [ imports = [
inputs.treefmt-nix.flakeModule inputs.treefmt-nix.flakeModule
inputs.git-hooks-nix.flakeModule inputs.pre-commit-hooks.flakeModule
]; ];
perSystem = perSystem = _: {
{ ... }:
{
treefmt.config = { treefmt.config = {
projectRootFile = ".git/config"; projectRootFile = ".git/config";
programs = { programs.alejandra.enable = true;
nixfmt-rfc-style.enable = true;
deadnix.enable = true;
};
}; };
pre-commit.settings.hooks = { pre-commit.settings.hooks = {
nixfmt-rfc-style.enable = true; alejandra.enable = true;
deadnix.enable = true; # deadnix.enable = true;
# statix.enable = true;
}; };
}; };
flake.checks = flake.checks = let
let
build = _: nc: nc.config.system.build.toplevel; build = _: nc: nc.config.system.build.toplevel;
in in {
{
x86_64-linux = lib.mapAttrs build { x86_64-linux = lib.mapAttrs build {
inherit (self.nixosConfigurations) picard; inherit (self.nixosConfigurations) picard;
}; };

68
flake.lock generated
View file

@ -50,11 +50,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1726775926, "lastModified": 1726730453,
"narHash": "sha256-5zShvCy9S4tuISFjNSjb+TWpPtORqPbRZ0XwbLbPLho=", "narHash": "sha256-Kdi7liMdbr1/uyMhMDl19O5b9LESxcnYgBRZblrJi9E=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "624fd86460e482017ed9c3c3c55a3758c06a4e7f", "rev": "a31fe5ef162f2f963308289e6e27d37e3948a983",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -241,33 +241,10 @@
"type": "github" "type": "github"
} }
}, },
"git-hooks-nix": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1726745158,
"narHash": "sha256-D5AegvGoEjt4rkKedmxlSEmC+nNLMBPWFxvmYnVLhjk=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "4e743a6920eab45e8ba0fbe49dc459f1423a4b74",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": { "gitignore": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"git-hooks-nix", "pre-commit-hooks",
"nixpkgs" "nixpkgs"
] ]
}, },
@ -353,11 +330,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1726823634, "lastModified": 1726745512,
"narHash": "sha256-rU8Yy62KSLU8Q2J64F+50OJKORNdogxbXl2w4rFw13o=", "narHash": "sha256-9xY9UEKC7gsA4sj5cZvZXk5jT/p2wGtkpp8hqE9yIRA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "4803bf558bdf20cb067aceb8830b7ad70113f4e3", "rev": "7578176649a08abb73dfbd2755a5988766952b53",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -761,11 +738,11 @@
}, },
"nixpkgs_5": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1726836432, "lastModified": 1726757509,
"narHash": "sha256-fk9P0RY2m7r3vAqqSRaR/MZoQJo6yg6vuv4h7D1I2/8=", "narHash": "sha256-3/2rV78QyC/OPu+WzimbElmSdD3HsQq/P/TLcFQHjZQ=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b3e9ef326d3d60dd97c262c6d16cc255175d4902", "rev": "78fdf431cdf6bc4ba4af9c100aaeda65da7e4ed3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -874,6 +851,29 @@
"type": "gitlab" "type": "gitlab"
} }
}, },
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1726745158,
"narHash": "sha256-D5AegvGoEjt4rkKedmxlSEmC+nNLMBPWFxvmYnVLhjk=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "4e743a6920eab45e8ba0fbe49dc459f1423a4b74",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"purescript-overlay": { "purescript-overlay": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -944,7 +944,6 @@
"disko": "disko", "disko": "disko",
"dream2nix": "dream2nix", "dream2nix": "dream2nix",
"flakeParts": "flakeParts", "flakeParts": "flakeParts",
"git-hooks-nix": "git-hooks-nix",
"homeManager": "homeManager", "homeManager": "homeManager",
"homeManagerGitWorkspace": "homeManagerGitWorkspace", "homeManagerGitWorkspace": "homeManagerGitWorkspace",
"impermanence": "impermanence", "impermanence": "impermanence",
@ -956,6 +955,7 @@
"nixThePlanet": "nixThePlanet", "nixThePlanet": "nixThePlanet",
"nixosHardware": "nixosHardware", "nixosHardware": "nixosHardware",
"nixpkgs": "nixpkgs_5", "nixpkgs": "nixpkgs_5",
"pre-commit-hooks": "pre-commit-hooks",
"rock5b": "rock5b", "rock5b": "rock5b",
"treefmt-nix": "treefmt-nix_2", "treefmt-nix": "treefmt-nix_2",
"vscode-server": "vscode-server" "vscode-server": "vscode-server"

View file

@ -20,8 +20,8 @@
url = "github:nix-community/disko"; url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
git-hooks-nix = { pre-commit-hooks = {
url = "github:cachix/git-hooks.nix"; url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
agenix.url = "github:ryantm/agenix"; agenix.url = "github:ryantm/agenix";
@ -57,8 +57,7 @@
vscode-server.url = "github:nix-community/nixos-vscode-server"; vscode-server.url = "github:nix-community/nixos-vscode-server";
}; };
outputs = outputs = inputs @ {flakeParts, ...}:
inputs@{ flakeParts, ... }:
flakeParts.lib.mkFlake {inherit inputs;} { flakeParts.lib.mkFlake {inherit inputs;} {
imports = [ imports = [
# TODO export modules as flake outputs # TODO export modules as flake outputs
@ -69,9 +68,6 @@
./shell ./shell
./checks ./checks
]; ];
systems = [ systems = ["x86_64-linux" "aarch64-linux"];
"x86_64-linux"
"aarch64-linux"
];
}; };
} }

View file

@ -1,4 +1,3 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = [pkgs.binance]; home.packages = [pkgs.binance];
} }

View file

@ -1,21 +1,18 @@
{ pkgs, ... }: {pkgs, ...}: {
{
programs.btop = { programs.btop = {
enable = true; enable = true;
settings = { settings = {
update_ms = 100; update_ms = 100;
theme_background = false; theme_background = false;
# color_theme = "${config.programs.btop.package}/share/btop/themes/dracula.theme"; # color_theme = "${config.programs.btop.package}/share/btop/themes/dracula.theme";
color_theme = color_theme = let
let
catppuccin-theme = pkgs.fetchFromGitHub { catppuccin-theme = pkgs.fetchFromGitHub {
owner = "catppuccin"; owner = "catppuccin";
repo = "btop"; repo = "btop";
rev = "21b8d5956a8b07fa52519e3267fb3a2d2e693d17"; rev = "21b8d5956a8b07fa52519e3267fb3a2d2e693d17";
hash = "sha256-UXeTypc15MhjgGUiCrDUZ40m32yH2o1N+rcrEgY6sME="; hash = "sha256-UXeTypc15MhjgGUiCrDUZ40m32yH2o1N+rcrEgY6sME=";
}; };
in in "${catppuccin-theme}/themes/catppuccin_mocha.theme";
"${catppuccin-theme}/themes/catppuccin_mocha.theme";
}; };
}; };
} }

View file

@ -1,4 +1,3 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = [pkgs.calibre]; home.packages = [pkgs.calibre];
} }

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
programs.chromium = { programs.chromium = {
enable = true; enable = true;
package = pkgs.google-chrome; package = pkgs.google-chrome;

View file

@ -1,8 +1,6 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = [ home.packages = [
( (let
let
cura5 = pkgs.appimageTools.wrapType2 rec { cura5 = pkgs.appimageTools.wrapType2 rec {
name = "cura5"; name = "cura5";
version = "5.8.0"; version = "5.8.0";
@ -25,7 +23,6 @@
args+=("$a") args+=("$a")
done done
QT_QPA_PLATFORM=xcb exec "${cura5}/bin/cura5" "''${args[@]}" QT_QPA_PLATFORM=xcb exec "${cura5}/bin/cura5" "''${args[@]}"
'' '')
)
]; ];
} }

View file

@ -1,4 +1,3 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = [pkgs.digikam]; home.packages = [pkgs.digikam];
} }

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = [pkgs.discord]; home.packages = [pkgs.discord];
home.file.".config/discord/settings.json".text = builtins.toJSON { home.file.".config/discord/settings.json".text = builtins.toJSON {
SKIP_HOST_UPDATE = true; SKIP_HOST_UPDATE = true;

View file

@ -1,4 +1,3 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = [pkgs.dolphin-emu]; home.packages = [pkgs.dolphin-emu];
} }

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
# home.packages = [pkgs.schildichat-desktop]; # home.packages = [pkgs.schildichat-desktop];
home.packages = [pkgs.element-desktop-wayland]; home.packages = [pkgs.element-desktop-wayland];

View file

@ -1,9 +1,9 @@
{ {
lib, lib,
age, age,
pkgs,
... ...
}: }: {
{
ccrEmacs.enable = true; ccrEmacs.enable = true;
home.sessionVariables.EDITOR = lib.mkForce "emacsclient"; home.sessionVariables.EDITOR = lib.mkForce "emacsclient";
systemd.user.services.emacs.Service.EnvironmentFile = age.secrets.chatgpt-token.path; systemd.user.services.emacs.Service.EnvironmentFile = age.secrets.chatgpt-token.path;

View file

@ -2,22 +2,19 @@
pkgs, pkgs,
secrets, secrets,
... ...
}: }: {
{
programs.mbsync.enable = true; programs.mbsync.enable = true;
programs.msmtp.enable = true; programs.msmtp.enable = true;
services.mbsync.enable = true; services.mbsync.enable = true;
home.file.".config/aerc/stylesets" = home.file.".config/aerc/stylesets" = let
let
catppuccin-aerc = pkgs.fetchFromGitHub { catppuccin-aerc = pkgs.fetchFromGitHub {
owner = "catppuccin"; owner = "catppuccin";
repo = "aerc"; repo = "aerc";
rev = "ca404a9f2d125ef12db40db663d43c9d94116a05"; rev = "ca404a9f2d125ef12db40db663d43c9d94116a05";
hash = "sha256-OWIkHsKFts/zkrDUtbBPXHVSrHL/F0v3LB1rnlFAKmE="; hash = "sha256-OWIkHsKFts/zkrDUtbBPXHVSrHL/F0v3LB1rnlFAKmE=";
}; };
in in {
{
source = "${catppuccin-aerc}/dist"; source = "${catppuccin-aerc}/dist";
recursive = true; recursive = true;
}; };
@ -84,9 +81,7 @@
"<Esc>" = ":clear<Enter>"; "<Esc>" = ":clear<Enter>";
}; };
"messages:folder=Drafts" = { "messages:folder=Drafts" = {"<Enter>" = ":recall<Enter>";};
"<Enter>" = ":recall<Enter>";
};
view = { view = {
"/" = ":toggle-key-passthrough<Enter>/"; "/" = ":toggle-key-passthrough<Enter>/";
@ -169,12 +164,8 @@
border-char-vertical = ""; border-char-vertical = "";
border-char-horizontal = ""; border-char-horizontal = "";
}; };
viewer = { viewer = {always-show-mime = true;};
always-show-mime = true; compose = {no-attachment-warning = "^[^>]*attach(ed|ment)";};
};
compose = {
no-attachment-warning = "^[^>]*attach(ed|ment)";
};
triggers = { triggers = {
email-received = ''exec notify-send "New email from %n" "%s"''; email-received = ''exec notify-send "New email from %n" "%s"'';
}; };

View file

@ -2,8 +2,7 @@
pkgs, pkgs,
username, username,
... ...
}: }: {
{
programs.firefox = { programs.firefox = {
enable = true; enable = true;
package = pkgs.wrapFirefox pkgs.firefox-unwrapped { package = pkgs.wrapFirefox pkgs.firefox-unwrapped {

View file

@ -6,16 +6,14 @@
}: }:
lib.mkMerge [ lib.mkMerge [
{ {
programs.foot = programs.foot = let
let
catppuccin = pkgs.fetchFromGitHub { catppuccin = pkgs.fetchFromGitHub {
owner = "catppuccin"; owner = "catppuccin";
repo = "foot"; repo = "foot";
rev = "307611230661b7b1787feb7f9d122e851bae97e9"; rev = "307611230661b7b1787feb7f9d122e851bae97e9";
hash = "sha256-mkPYHDJtfdfDnqLr1YOjaBpn4lCceok36LrnkUkNIE4="; hash = "sha256-mkPYHDJtfdfDnqLr1YOjaBpn4lCceok36LrnkUkNIE4=";
}; };
in in {
{
enable = true; enable = true;
server.enable = true; server.enable = true;
settings = { settings = {
@ -25,8 +23,7 @@ lib.mkMerge [
dpi-aware = "no"; dpi-aware = "no";
horizontal-letter-offset = "1"; horizontal-letter-offset = "1";
include = "${catppuccin}/themes/catppuccin-mocha.ini"; include = "${catppuccin}/themes/catppuccin-mocha.ini";
font = font = let
let
size = "13"; size = "13";
in in
lib.concatStringsSep ", " [ lib.concatStringsSep ", " [
@ -46,7 +43,7 @@ lib.mkMerge [
scrollback-up-page = "Control+Shift+k"; scrollback-up-page = "Control+Shift+k";
scrollback-down-page = "Control+Shift+j"; scrollback-down-page = "Control+Shift+j";
search-start = "Control+Shift+s"; search-start = "Control+Shift+s";
pipe-command-output = ''[sh -c 'f=$(mktemp); cat - > $f; footclient hx $f; rm $f'] Control+Shift+g''; pipe-command-output = ''[sh -c "f=$(mktemp); cat - > $f; footclient hx $f; rm $f"] Control+Shift+g'';
}; };
mouse = { mouse = {
@ -66,7 +63,7 @@ lib.mkMerge [
onEvent = "fish_preexec"; onEvent = "fish_preexec";
}; };
foot_cmd_end = { foot_cmd_end = {
body = ''echo -en "\e]133;D\e\\"''; body = ''echo -en "\e]133;D\e\\'';
onEvent = "fish_postexec"; onEvent = "fish_postexec";
}; };
}; };

View file

@ -2,8 +2,7 @@
age, age,
username, username,
... ...
}: }: {
{
services.git-workspace = { services.git-workspace = {
enable = true; enable = true;
frequency = "04:00:00"; frequency = "04:00:00";

View file

@ -2,18 +2,13 @@
pkgs, pkgs,
username, username,
... ...
}: }: let
let
config = { config = {
name = "Andrea Ciceri"; name = "Andrea Ciceri";
email = "andrea.ciceri@autistici.org"; email = "andrea.ciceri@autistici.org";
}; };
in in {
{ imports = [../gitui ../lazygit];
imports = [
../gitui
../lazygit
];
programs.git = { programs.git = {
enable = true; enable = true;
package = pkgs.gitAndTools.gitFull; package = pkgs.gitAndTools.gitFull;

View file

@ -1,9 +1,9 @@
{ {
pkgs, pkgs,
lib, lib,
config,
... ...
}: }: {
{
services.gnome-keyring = { services.gnome-keyring = {
enable = false; # Is this broken? https://github.com/nix-community/home-manager/issues/1454 enable = false; # Is this broken? https://github.com/nix-community/home-manager/issues/1454
components = lib.mkForce [ components = lib.mkForce [

View file

@ -1,23 +1,17 @@
{ pkgs, ... }: {pkgs, ...}: {
{
services.gpg-agent = { services.gpg-agent = {
enable = true; enable = true;
enableSshSupport = true; enableSshSupport = true;
sshKeys = ["CE2FD0D9BECBD8876811714925066CC257413416"]; sshKeys = ["CE2FD0D9BECBD8876811714925066CC257413416"];
extraConfig = extraConfig = let
let
pinentryRofi = pkgs.writeShellApplication { pinentryRofi = pkgs.writeShellApplication {
name = "pinentry-rofi-with-env"; name = "pinentry-rofi-with-env";
runtimeInputs = with pkgs; [ runtimeInputs = with pkgs; [coreutils rofi];
coreutils
rofi
];
text = '' text = ''
"${pkgs.pinentry-rofi}/bin/pinentry-rofi" "$@" "${pkgs.pinentry-rofi}/bin/pinentry-rofi" "$@"
''; '';
}; };
in in ''
''
allow-emacs-pinentry allow-emacs-pinentry
allow-loopback-pinentry allow-loopback-pinentry
pinentry-program ${pinentryRofi}/bin/pinentry-rofi-with-env pinentry-program ${pinentryRofi}/bin/pinentry-rofi-with-env

View file

@ -1,12 +1,11 @@
{ {
config,
lib, lib,
... ...
}: }: let
let
originalConfig = config.wayland.windowManager.hyprland.extraConfig; originalConfig = config.wayland.windowManager.hyprland.extraConfig;
config = builtins.replaceStrings ["SUPER"] [""] originalConfig; config = builtins.replaceStrings ["SUPER"] [""] originalConfig;
in in {
{
systemd.user.services.headless-hyprland = { systemd.user.services.headless-hyprland = {
Unit.Description = "Headless Hyprland"; Unit.Description = "Headless Hyprland";
Service = { Service = {

View file

@ -1,17 +1,17 @@
{ {
config, config,
pkgs, pkgs,
lib,
... ...
}: }: let
let screenshotScript = pkgs.writeShellScript "screenshot.sh" ''
screenshotScript = pkgs.writeShellScriptBin "screenshot.sh" ''
filename="$HOME/shots/$(date --iso-8601=seconds).png" filename="$HOME/shots/$(date --iso-8601=seconds).png"
coords="$(${pkgs.slurp}/bin/slurp)" coords="$(${pkgs.slurp}/bin/slurp)"
${pkgs.grim}/bin/grim -t png -g "$coords" "$filename" ${pkgs.grim}/bin/grim -t png -g "$coords" "$filename"
wl-copy -t image/png < $filename wl-copy -t image/png < $filename
''; '';
hyprland = config.wayland.windowManager.hyprland.package; hyprland = config.wayland.windowManager.hyprland.package;
switchMonitorScript = pkgs.writeShellScriptBin "switch-monitor.sh" '' switchMonitorScript = pkgs.writeShellScript "switch-monitor.sh" ''
if [[ "$(${hyprland}/bin/hyprctl monitors) | grep '\sDP-[0-9]+'" ]]; then if [[ "$(${hyprland}/bin/hyprctl monitors) | grep '\sDP-[0-9]+'" ]]; then
if [[ $1 == "open" ]]; then if [[ $1 == "open" ]]; then
${hyprland}/bin/hyprctl keyword monitor "eDP-1,1920x1080,3760x230,1" ${hyprland}/bin/hyprctl keyword monitor "eDP-1,1920x1080,3760x230,1"
@ -20,8 +20,7 @@ let
fi fi
fi fi
''; '';
in in {
{
imports = [ imports = [
./hyprpaper.nix ./hyprpaper.nix
../waybar ../waybar
@ -33,15 +32,7 @@ in
../foot ../foot
]; ];
home.packages = with pkgs; [ home.packages = with pkgs; [wl-clipboard waypipe];
wl-clipboard
waypipe
switchMonitorScript
screenshotScript
hyprpaper
fuzzel
brightnessctl
];
systemd.user.sessionVariables = { systemd.user.sessionVariables = {
NIXOS_OZONE_WL = "1"; NIXOS_OZONE_WL = "1";
@ -107,11 +98,133 @@ in
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;
plugins = with pkgs.hyprlandPlugins; [ extraConfig = ''
hy3 cursor {
hyprspace hide_on_key_press = true
]; enable_hyprcursor = true
# TODO migrate to structured options zoom_rigid = true
extraConfig = builtins.readFile ./hyprland.conf; }
env = HYPRCURSOR_THEME,catppuccin-mocha-sapphire
env = HYPRCURSOR_SIZE,48
env = XCURSOR_THEME,catppuccin-mocha-sapphire
env = XCURSOR_SIZE,48
$mod = SUPER
input {
touchpad {
disable_while_typing = true # set to true while playing
}
}
monitor = HDMI-A-1, 2560x1440, 0x0, 1 # picard
monitor = eDP-1, 1920x1080, 0x0, 1 # kirk
bindl=,switch:off:Lid Switch,exec,${switchMonitorScript} open
bindl=,switch:on:Lid Switch,exec,${switchMonitorScript} close
exec-once = ${pkgs.hyprpaper}/bin/hyprpaper
windowrulev2 = tile, class:^(Spotify)$
windowrulev2 = workspace 9, class:^(Spotify)$
windowrulev2 = float, title:^(floating)$
bind = $mod, b, exec, firefox
bind = $mod, t, exec, footclient
bind = $mod, RETURN, exec, emacsclient -c --eval "(ccr/start-eshell)"
bind = $mod SHIFT, g, exec, emacsclient -c --eval "(ccr/start-chatgpt)"
bind = $mod, x, exec, emacsclient -c
bind = $mod SHIFT, n, exec, emacsclient --eval '(ccr/org-capture "n")' -c -F '((name . "floating"))'
bind = $mod SHIFT, w, exec, emacsclient --eval '(ccr/org-capture "j")' -c -F '((name . "floating"))'
bind = $mod, y, exec, ${pkgs.waypipe}/bin/waypipe --compress lz4=10 ssh picard.fleet emacsclient -c
bind = $mod, d, exec, ${pkgs.fuzzel}/bin/fuzzel --background-color=253559cc --border-radius=5 --border-width=0
bind = $mod, s, exec, ${screenshotScript}
bind = , XF86MonBrightnessUp, exec, ${pkgs.brightnessctl}/bin/brightnessctl s +5%
bind = , XF86MonBrightnessDown, exec, ${pkgs.brightnessctl}/bin/brightnessctl s 5%-
bind = $mod, code:60, exec, ${pkgs.brightnessctl}/bin/brightnessctl s +5%
bind = $mod, code:59, exec, ${pkgs.brightnessctl}/bin/brightnessctl s 5%-
bind = $mod SHIFT, t, togglegroup
bind = $mod, G, changegroupactive
bind = $mod SHIFT, q, killactive
bind = $mod SHIFT, f, fullscreen, 0
bind = $mod SHIFT, e, exit
bind = $mod, h, movefocus, l
bind = $mod, l, movefocus, r
bind = $mod, k, movefocus, u
bind = $mod, j, movefocus, d
bind = $mod SHIFT, h, movewindow, l
bind = $mod SHIFT, l, movewindow, r
bind = $mod SHIFT, k, movewindow, u
bind = $mod SHIFT, j ,movewindow, d
bind = $mod, p, movecurrentworkspacetomonitor, r
bind = $mod, o, movecurrentworkspacetomonitor, l
bindm=ALT,mouse:272,movewindow
bind = $mod, 1, workspace, 1
bind = $mod, 2, workspace, 2
bind = $mod, 3, workspace, 3
bind = $mod, 4, workspace, 4
bind = $mod, 5, workspace, 5
bind = $mod, 6, workspace, 6
bind = $mod, 7, workspace, 7
bind = $mod, 8, workspace, 8
bind = $mod, 9, workspace, 9
bind = $mod, 0, workspace, 10
bind = $mod SHIFT, 1, movetoworkspace, 1
bind = $mod SHIFT, 2, movetoworkspace, 2
bind = $mod SHIFT, 3, movetoworkspace, 3
bind = $mod SHIFT, 4, movetoworkspace, 4
bind = $mod SHIFT, 5, movetoworkspace, 5
bind = $mod SHIFT, 6, movetoworkspace, 6
bind = $mod SHIFT, 7, movetoworkspace, 7
bind = $mod SHIFT, 8, movetoworkspace, 8
bind = $mod SHIFT, 9, movetoworkspace, 9
bind = $mod SHIFT, 0, movetoworkspace, 10
general {
gaps_in = 0
gaps_out = 0
border_size = 1
col.active_border = rgba(AF8D61FF) rgba(CEB153FF) rgba(7B8387FF) 45deg
col.inactive_border = rgba(AF8D6166)
}
decoration {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
rounding = 2
# blur = true
# blur_size = 8
# blur_passes = 1
# blur_new_optimizations = true
drop_shadow = true
shadow_range = 4
shadow_render_power = 3
col.shadow = rgba(a8cfee11)
}
animations {
enabled = true
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 3, myBezier
animation = windowsOut, 1, 3, default, popin 80%
animation = border, 1, 5, default
animation = borderangle, 1, 4, default
animation = fade, 1, 3, default
animation = workspaces, 1, 3, default
}
'';
}; };
} }

View file

@ -1,184 +0,0 @@
cursor {
hide_on_key_press = true
enable_hyprcursor = true
zoom_rigid = true
}
env = HYPRCURSOR_THEME,catppuccin-mocha-sapphire
env = HYPRCURSOR_SIZE,48
env = XCURSOR_THEME,catppuccin-mocha-sapphire
env = XCURSOR_SIZE,48
$mod = SUPER
input {
touchpad {
disable_while_typing = true # set to true while playing
}
}
monitor = HDMI-A-1, 2560x1440, 0x0, 1 # picard
monitor = eDP-1, 1920x1080, 0x0, 1 # kirk
bindl=,switch:off:Lid Switch,exec,switch-monitor.sh open
bindl=,switch:on:Lid Switch,exec,switch-monitor.sh close
exec-once = hyprpaper
windowrulev2 = tile, class:^(Spotify)$
windowrulev2 = workspace 9, class:^(Spotify)$
windowrulev2 = float, title:^(floating)$
bind = $mod, b, exec, firefox
bind = $mod, t, exec, footclient
bind = $mod, y, exec, waypipe --compress lz4=10 ssh picard.fleet emacsclient -c
bind = $mod, d, exec, fuzzel --background-color=253559cc --border-radius=5 --border-width=0
bind = $mod, s, exec, screenshot.sh
bind = , XF86MonBrightnessUp, exec, brightnessctl s +5%
bind = , XF86MonBrightnessDown, exec, brightnessctl s 5%-
bind = $mod, code:60, exec, brightnessctl s +5%
bind = $mod, code:59, exec, brightnessctl s 5%-
bind = $mod SHIFT, t, hy3:makegroup, tab, ephemeral
bind = $mod SHIFT, q, killactive
bind = $mod SHIFT, f, fullscreen, 0
bind = $mod SHIFT, e, exit
bind = $mod, h, hy3:movefocus, l
bind = $mod, l, hy3:movefocus, r
bind = $mod, k, hy3:movefocus, u
bind = $mod, j, hy3:movefocus, d
bind = $mod SHIFT, h, hy3:movewindow, l
bind = $mod SHIFT, l, hy3:movewindow, r
bind = $mod SHIFT, k, hy3:movewindow, u
bind = $mod SHIFT, j ,hy3:movewindow, d
bind = $mod, v, hy3:makegroup, v
bind = $mod SHIFT, v, hy3:makegroup, h
bind = $mod, p, movecurrentworkspacetomonitor, r
bind = $mod, o, movecurrentworkspacetomonitor, l
bindm=ALT,mouse:272,hy3:movewindow
bind = $mod, 1, workspace, 1
bind = $mod, 2, workspace, 2
bind = $mod, 3, workspace, 3
bind = $mod, 4, workspace, 4
bind = $mod, 5, workspace, 5
bind = $mod, 6, workspace, 6
bind = $mod, 7, workspace, 7
bind = $mod, 8, workspace, 8
bind = $mod, 9, workspace, 9
bind = $mod, 0, workspace, 10
bind = $mod SHIFT, 1, movetoworkspace, 1
bind = $mod SHIFT, 2, movetoworkspace, 2
bind = $mod SHIFT, 3, movetoworkspace, 3
bind = $mod SHIFT, 4, movetoworkspace, 4
bind = $mod SHIFT, 5, movetoworkspace, 5
bind = $mod SHIFT, 6, movetoworkspace, 6
bind = $mod SHIFT, 7, movetoworkspace, 7
bind = $mod SHIFT, 8, movetoworkspace, 8
bind = $mod SHIFT, 9, movetoworkspace, 9
bind = $mod SHIFT, 0, movetoworkspace, 10
general {
layout = hy3
gaps_in = 8
gaps_out = 5
}
decoration {
rounding = 8
drop_shadow = true
shadow_range = 4
shadow_render_power = 3
col.shadow = rgba(a8cfee11)
}
animations {
enabled = true
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 3, myBezier
animation = windowsOut, 1, 3, default, popin 80%
animation = border, 1, 5, default
animation = borderangle, 1, 4, default
animation = fade, 1, 3, default
animation = workspaces, 1, 3, default
}
plugin {
hy3 {
# disable gaps when only one window is onscreen
# 0 - always show gaps
# 1 - hide gaps with a single window onscreen
# 2 - 1 but also show the window border
no_gaps_when_only = 0 # default: 0
# policy controlling what happens when a node is removed from a group,
# leaving only a group
# 0 = remove the nested group
# 1 = keep the nested group
# 2 = keep the nested group only if its parent is a tab group
node_collapse_policy = 2 # default: 2
# offset from group split direction when only one window is in a group
group_inset = 0 # default: 10
# if a tab group will automatically be created for the first window spawned in a workspace
tab_first_window = false
# tab group settings
tabs {
# height of the tab bar
height = 20
# padding between the tab bar and its focused node
padding = 10
# the tab bar should animate in/out from the top instead of below the window
from_top = false
# rounding of tab bar corners
rounding = 4
# render the window title on the bar
render_text = true
# center the window title
text_center = true
# font to render the window title with
text_font = Fira Code
# height of the window title
text_height = 14
# left padding of the window title
text_padding = 4
# active tab bar segment color
# col.active = <color> # default: 0xff32b4ff
# urgent tab bar segment color
# col.urgent = <color> # default: 0xffff4f4f
# inactive tab bar segment color
# col.inactive = <color> # default: 0x80808080
# active tab bar text color
# col.text.active = <color> # default: 0xff000000
# urgent tab bar text color
# col.text.urgent = <color> # default: 0xff000000
# inactive tab bar text color
# col.text.inactive = <color> # default: 0xff000000
}
}
}

View file

@ -1,9 +1,7 @@
let let
wallpaper = ./wallpaper.png; wallpaper = ./wallpaper.png;
in in {
{
xdg.configFile."hypr/hyprpaper.conf".text = '' xdg.configFile."hypr/hyprpaper.conf".text = ''
splash = false
preload = ${wallpaper} preload = ${wallpaper}
wallpaper = eDP-1,${wallpaper} wallpaper = eDP-1,${wallpaper}
wallpaper = DP-1,${wallpaper} wallpaper = DP-1,${wallpaper}

View file

@ -1,4 +1,3 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = [pkgs.kicad-small]; home.packages = [pkgs.kicad-small];
} }

View file

@ -1,5 +1,4 @@
{ ... }: {pkgs, ...}: {
{
programs.kitty = { programs.kitty = {
enable = true; enable = true;
font = { font = {

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
programs.lazygit = { programs.lazygit = {
enable = true; enable = true;
settings = { settings = {

View file

@ -1,4 +1,3 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = [pkgs.lutris]; home.packages = [pkgs.lutris];
} }

View file

@ -1,4 +1,3 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = [pkgs.monero-gui]; home.packages = [pkgs.monero-gui];
} }

View file

@ -1,4 +1,3 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = [pkgs.moonlight-qt]; home.packages = [pkgs.moonlight-qt];
} }

View file

@ -1,6 +1,5 @@
# TODO: use upstream ytmusic when updated: https://github.com/OzymandiasTheGreat/mopidy-ytmusic/issues/68 # TODO: use upstream ytmusic when updated: https://github.com/OzymandiasTheGreat/mopidy-ytmusic/issues/68
{ pkgs, ... }: {pkgs, ...}: let
let
ytmusicapi = pkgs.python310Packages.buildPythonPackage rec { ytmusicapi = pkgs.python310Packages.buildPythonPackage rec {
pname = "ytmusicapi"; pname = "ytmusicapi";
version = "0.24.0"; version = "0.24.0";
@ -43,16 +42,10 @@ let
doCheck = false; doCheck = false;
}; };
in in {
{
services.mopidy = { services.mopidy = {
enable = true; enable = true;
extensionPackages = extensionPackages = [mopidy-ytmusic] ++ (with pkgs; [mopidy-mpd mopidy-mpris]);
[ mopidy-ytmusic ]
++ (with pkgs; [
mopidy-mpd
mopidy-mpris
]);
settings = { settings = {
mpd = { mpd = {
enabled = true; enabled = true;

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = [pkgs.nheko]; home.packages = [pkgs.nheko];
# systemd.user.services.nheko = { # systemd.user.services.nheko = {

View file

@ -1,15 +1,14 @@
{ {
config,
pkgs, pkgs,
fleetFlake, fleetFlake,
lib,
... ...
}: }: {
{
programs.nix-index.enable = true; programs.nix-index.enable = true;
systemd.user.services.nix-index-update = { systemd.user.services.nix-index-update = {
Unit = { Unit = {Description = "Update nix-index";};
Description = "Update nix-index";
};
Service = { Service = {
CPUSchedulingPolicy = "idle"; CPUSchedulingPolicy = "idle";
@ -19,9 +18,7 @@
}; };
systemd.user.timers.nix-index-update = { systemd.user.timers.nix-index-update = {
Unit = { Unit = {Description = "Update nix-index";};
Description = "Update nix-index";
};
Timer = { Timer = {
Unit = "nix-index-update.service"; Unit = "nix-index-update.service";
@ -29,8 +26,6 @@
Persistent = true; Persistent = true;
}; };
Install = { Install = {WantedBy = ["timers.target"];};
WantedBy = [ "timers.target" ];
};
}; };
} }

View file

@ -1,10 +1,6 @@
{ pkgs, ... }: {pkgs, ...}: {
{
programs.obs-studio = { programs.obs-studio = {
enable = true; enable = true;
plugins = with pkgs.obs-studio-plugins; [ plugins = with pkgs.obs-studio-plugins; [wlrobs input-overlay];
wlrobs
input-overlay
];
}; };
} }

View file

@ -1,4 +1,3 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = [pkgs.openscad]; home.packages = [pkgs.openscad];
} }

View file

@ -2,8 +2,7 @@
pkgs, pkgs,
username, username,
... ...
}: }: {
{
programs.password-store = { programs.password-store = {
enable = true; enable = true;
settings = { settings = {

View file

@ -2,8 +2,7 @@
pkgs, pkgs,
config, config,
... ...
}: }: let
let
inherit (config.programs.qutebrowser) settings; inherit (config.programs.qutebrowser) settings;
websites = { websites = {
searx = "https://searx.be"; searx = "https://searx.be";
@ -17,8 +16,7 @@ let
less-dark-white = "#cccccc"; less-dark-white = "#cccccc";
blue = "#0000ff"; blue = "#0000ff";
}; };
in in {
{
programs.qutebrowser = { programs.qutebrowser = {
enable = true; enable = true;
searchEngines = with websites; { searchEngines = with websites; {
@ -110,13 +108,15 @@ in
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [
fuzzel fuzzel
(makeDesktopItem { (
makeDesktopItem {
name = "qutebrowser"; name = "qutebrowser";
exec = "qutebrowser %u"; exec = "qutebrowser %u";
comment = "Qutebrowser"; comment = "Qutebrowser";
desktopName = "qutebrowser"; desktopName = "qutebrowser";
type = "Application"; type = "Application";
mimeTypes = ["x-scheme-handler/https"]; mimeTypes = ["x-scheme-handler/https"];
}) }
)
]; ];
} }

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: let
let
reinstall-magisk-on-lineage = pkgs.stdenv.mkDerivation { reinstall-magisk-on-lineage = pkgs.stdenv.mkDerivation {
name = "reinstall-magisk-on-lineage"; name = "reinstall-magisk-on-lineage";
version = "git"; version = "git";
@ -22,7 +21,6 @@ let
--replace-fail "paste_yours_here" "\"\$1\"" --replace-fail "paste_yours_here" "\"\$1\""
''; '';
}; };
in in {
{
home.packages = [reinstall-magisk-on-lineage]; home.packages = [reinstall-magisk-on-lineage];
} }

View file

@ -1,4 +1,3 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = [pkgs.remmina]; home.packages = [pkgs.remmina];
} }

View file

@ -4,8 +4,7 @@
age, age,
hostname, hostname,
... ...
}: }: {
{
programs.bat.enable = true; programs.bat.enable = true;
programs.direnv = { programs.direnv = {
@ -32,9 +31,7 @@
systemd.user.services.atuind = { systemd.user.services.atuind = {
Unit.Description = "Atuin daemon"; Unit.Description = "Atuin daemon";
Install = { Install = {WantedBy = ["default.target"];};
WantedBy = [ "default.target" ];
};
Service.ExecStart = "${lib.getExe pkgs.atuin} daemon"; Service.ExecStart = "${lib.getExe pkgs.atuin} daemon";
}; };
@ -119,29 +116,25 @@
xdg.configFile = { xdg.configFile = {
"dracula-theme" = { "dracula-theme" = {
target = "fish/themes/dracula.theme"; target = "fish/themes/dracula.theme";
source = source = let
let
theme = pkgs.fetchFromGitHub { theme = pkgs.fetchFromGitHub {
owner = "dracula"; owner = "dracula";
repo = "fish"; repo = "fish";
rev = "269cd7d76d5104fdc2721db7b8848f6224bdf554"; rev = "269cd7d76d5104fdc2721db7b8848f6224bdf554";
hash = "sha256-Hyq4EfSmWmxwCYhp3O8agr7VWFAflcUe8BUKh50fNfY="; hash = "sha256-Hyq4EfSmWmxwCYhp3O8agr7VWFAflcUe8BUKh50fNfY=";
}; };
in in "${theme}/themes/Dracula\ Official.theme";
"${theme}/themes/Dracula\ Official.theme";
}; };
"catppuccin-theme" = { "catppuccin-theme" = {
target = "fish/themes/Catppuccin\ Mocha.theme"; target = "fish/themes/Catppuccin\ Mocha.theme";
source = source = let
let
theme = pkgs.fetchFromGitHub { theme = pkgs.fetchFromGitHub {
owner = "catppuccin"; owner = "catppuccin";
repo = "fish"; repo = "fish";
rev = "a3b9eb5eaf2171ba1359fe98f20d226c016568cf"; rev = "a3b9eb5eaf2171ba1359fe98f20d226c016568cf";
hash = "sha256-shQxlyoauXJACoZWtRUbRMxmm10R8vOigXwjxBhG8ng="; hash = "sha256-shQxlyoauXJACoZWtRUbRMxmm10R8vOigXwjxBhG8ng=";
}; };
in in "${theme}/themes/Catppuccin\ Mocha.theme";
"${theme}/themes/Catppuccin\ Mocha.theme";
}; };
}; };
@ -234,8 +227,7 @@
# ''; # '';
# }; # };
home.packages = home.packages = with pkgs;
with pkgs;
[ [
thefuck thefuck
htop-vim htop-vim
@ -248,18 +240,12 @@
carapace # used by nushell carapace # used by nushell
neovim neovim
] ]
++ (lib.optionals ++ (lib.optionals (builtins.elem hostname ["kirk" "picard"]) [
(builtins.elem hostname [
"kirk"
"picard"
])
[
nixd # TODO probably not the best place nixd # TODO probably not the best place
terraform-lsp # TODO probably not best place terraform-lsp # TODO probably not best place
python3Packages.jedi-language-server # TODO probably not best place python3Packages.jedi-language-server # TODO probably not best place
nodePackages.typescript-language-server # TODO probably not best place nodePackages.typescript-language-server # TODO probably not best place
cntr # TODO probably not best place cntr # TODO probably not best place
nom # FIXME disable on aarch64-linux, breaks everything :( nom # FIXME disable on aarch64-linux, breaks everything :(
] ]);
);
} }

View file

@ -1,4 +1,3 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = [pkgs.slack]; home.packages = [pkgs.slack];
} }

View file

@ -2,11 +2,9 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: let
let
spotify-adblocked = pkgs.callPackage ../../packages/spotify-adblocked {}; spotify-adblocked = pkgs.callPackage ../../packages/spotify-adblocked {};
in in {
{
home.packages = [spotify-adblocked]; home.packages = [spotify-adblocked];
systemd.user.services.spotify-adblocked = { systemd.user.services.spotify-adblocked = {

View file

@ -1,4 +1,3 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = [pkgs.steam-run]; home.packages = [pkgs.steam-run];
} }

View file

@ -3,8 +3,7 @@
lib, lib,
config, config,
... ...
}: }: {
{
imports = [ imports = [
../waybar ../waybar
../swayidle ../swayidle
@ -36,21 +35,17 @@
}; };
wayland = { wayland = {
windowManager.sway = windowManager.sway = let
let
modifier = "Mod4"; modifier = "Mod4";
in in {
{
enable = true; enable = true;
wrapperFeatures.gtk = true; wrapperFeatures.gtk = true;
config = { config = {
inherit modifier; inherit modifier;
menu = "${pkgs.fuzzel}/bin/fuzzel --background-color=253559cc --border-radius=5 --border-width=0"; menu = "${pkgs.fuzzel}/bin/fuzzel --background-color=253559cc --border-radius=5 --border-width=0";
output = output = let
let
bg = "${./wallpaper.svg} fill"; bg = "${./wallpaper.svg} fill";
in in {
{
DP-2 = { DP-2 = {
res = "1900x1200"; res = "1900x1200";
pos = "0 0"; pos = "0 0";
@ -80,10 +75,7 @@
smartBorders = "on"; smartBorders = "on";
}; };
assigns = { assigns = {
"1" = [ "1" = [{title = ".*Mozilla Firefox$";} {title = ".*qutebrowser$";}];
{ title = ".*Mozilla Firefox$"; }
{ title = ".*qutebrowser$"; }
];
"2" = [{title = "^((?!qutebrowser-editor).)*Emacs$";}]; "2" = [{title = "^((?!qutebrowser-editor).)*Emacs$";}];
"3" = [{title = "Slack.*";}]; "3" = [{title = "Slack.*";}];
"9" = [{title = "^Element.*";}]; "9" = [{title = "^Element.*";}];
@ -99,14 +91,19 @@
xkb_variant = "altgr-intl"; xkb_variant = "altgr-intl";
}; };
}; };
keybindings = keybindings = let
let
screenshotScript = pkgs.writeShellScript "screenshot.sh" '' screenshotScript = pkgs.writeShellScript "screenshot.sh" ''
filename="$HOME/shots/$(date --iso-8601=seconds).png" filename="$HOME/shots/$(date --iso-8601=seconds).png"
coords="$(${pkgs.slurp}/bin/slurp)" coords="$(${pkgs.slurp}/bin/slurp)"
${pkgs.grim}/bin/grim -t png -g "$coords" "$filename" ${pkgs.grim}/bin/grim -t png -g "$coords" "$filename"
wl-copy -t image/png < $filename wl-copy -t image/png < $filename
''; '';
screenrecordingScript = pkgs.writeShellScript "screenrecorder.sh" ''
filename="$HOME/shots/recording-$(date --iso-8601=seconds).mp4"
coords="$(${pkgs.slurp}/bin/slurp)"
${pkgs.wf-recorder}/bin/wf-recorder -g "$coords" -f "$filename"
wl-copy -t video/mp4 < $filename
'';
in in
lib.mkOptionDefault { lib.mkOptionDefault {
"${modifier}+x" = "exec emacsclient -c"; "${modifier}+x" = "exec emacsclient -c";

View file

@ -2,10 +2,8 @@
pkgs, pkgs,
lib, lib,
... ...
}: }: {
{ services.swayidle = let
services.swayidle =
let
swaylockWithArgs = pkgs.writeScriptBin "swaylockWithArgs" '' swaylockWithArgs = pkgs.writeScriptBin "swaylockWithArgs" ''
${pkgs.swaylock-effects}/bin/swaylock \ ${pkgs.swaylock-effects}/bin/swaylock \
--daemonize \ --daemonize \
@ -24,8 +22,7 @@
--fade-in 0.2 --fade-in 0.2
''; '';
swaylockCommand = "${swaylockWithArgs}/bin/swaylockWithArgs"; swaylockCommand = "${swaylockWithArgs}/bin/swaylockWithArgs";
in in {
{
enable = true; enable = true;
events = [ events = [
{ {

View file

@ -1,4 +1,3 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = [pkgs.teams-for-linux]; home.packages = [pkgs.teams-for-linux];
} }

View file

@ -1,4 +1,3 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = [pkgs.tor-browser]; home.packages = [pkgs.tor-browser];
} }

View file

@ -2,8 +2,7 @@
pkgs, pkgs,
lib, lib,
... ...
}: }: {
{
home.packages = [pkgs.tremotesf]; home.packages = [pkgs.tremotesf];
systemd.user.services.tremotesf = { systemd.user.services.tremotesf = {

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
programs.vscode = { programs.vscode = {
enable = true; enable = true;
# For a few reasons sometimes I'm forced to use VSCode and I don't have time to nixifiy even its configuration. # For a few reasons sometimes I'm forced to use VSCode and I don't have time to nixifiy even its configuration.

View file

@ -2,8 +2,7 @@
pkgs, pkgs,
lib, lib,
... ...
}: }: {
{
programs.waybar = { programs.waybar = {
enable = true; enable = true;
systemd.enable = true; systemd.enable = true;
@ -47,13 +46,9 @@
# sort-by-number = true; # sort-by-number = true;
}; };
"wlr/mode" = { "wlr/mode" = {tooltip = false;};
tooltip = false;
};
"wlr/window" = { "wlr/window" = {max_length = 50;};
max_length = 50;
};
tray = { tray = {
spacing = 10; spacing = 10;
}; };
@ -61,13 +56,7 @@
format = "{capacity}% {icon}"; format = "{capacity}% {icon}";
format-alt = "{time} {icon}"; format-alt = "{time} {icon}";
format-charging = "{capacity}% "; format-charging = "{capacity}% ";
format-icons = [ format-icons = [" " " " " " " " " "];
" "
" "
" "
" "
" "
];
format-plugged = "{capacity}% "; format-plugged = "{capacity}% ";
states = { states = {
critical = 15; critical = 15;
@ -82,9 +71,7 @@
format = "{usage}% "; format = "{usage}% ";
tooltip = false; tooltip = false;
}; };
memory = { memory = {format = "{}% ";};
format = "{}% ";
};
network = { network = {
interval = 1; interval = 1;
format-alt = "{ifname}: {ipaddr}/{cidr}"; format-alt = "{ifname}: {ipaddr}/{cidr}";
@ -99,11 +86,7 @@
format-bluetooth-muted = " {icon} {format_source}"; format-bluetooth-muted = " {icon} {format_source}";
format-icons = { format-icons = {
car = ""; car = "";
default = [ default = [" " " " " "];
" "
" "
" "
];
handsfree = ""; handsfree = "";
headphones = " "; headphones = " ";
headset = ""; headset = "";
@ -115,27 +98,18 @@
format-source-muted = ""; format-source-muted = "";
on-click = "${pkgs.pavucontrol}/bin/pavucontrol"; on-click = "${pkgs.pavucontrol}/bin/pavucontrol";
}; };
"wlr/mode" = { "wlr/mode" = {format = ''<span style="italic">{}</span>'';};
format = ''<span style="italic">{}</span>'';
};
temperature = { temperature = {
critical-threshold = 80; critical-threshold = 80;
format = "{temperatureC}°C {icon}"; format = "{temperatureC}°C {icon}";
format-icons = [ format-icons = ["" "" ""];
""
""
""
];
hwmon-path = "/sys/class/hwmon/hwmon2/temp1_input"; # picard FIXME hwmon-path = "/sys/class/hwmon/hwmon2/temp1_input"; # picard FIXME
# hwmon-path = "/sys/class/thermal/thermal_zone4/temp"; # thinkpad # hwmon-path = "/sys/class/thermal/thermal_zone4/temp"; # thinkpad
}; };
backlight = { backlight = {
device = "ddcci2"; device = "ddcci2";
format = "{percent}% {icon}"; format = "{percent}% {icon}";
format-icons = [ format-icons = [" " " "];
" "
" "
];
}; };
}; };
}; };

View file

@ -4,8 +4,7 @@
vpn, vpn,
hostname, hostname,
... ...
}: }: {
{
systemd.user.services.wayvnc = { systemd.user.services.wayvnc = {
Install.WantedBy = ["graphical-session.target"]; Install.WantedBy = ["graphical-session.target"];

View file

@ -2,12 +2,12 @@
pkgs, pkgs,
hostname, hostname,
... ...
}: }: {
{
programs.wezterm = { programs.wezterm = {
enable = true; enable = true;
package = package =
if hostname == "pircard" then if hostname == "pircard"
then
(pkgs.wezterm.overrideAttrs (old: rec { (pkgs.wezterm.overrideAttrs (old: rec {
pname = "wezterm"; pname = "wezterm";
version = "20240406-cce0706"; version = "20240406-cce0706";
@ -24,13 +24,17 @@
"xcb-imdkit-0.3.0" = "sha256-fTpJ6uNhjmCWv7dZqVgYuS2Uic36XNYTbqlaly5QBjI="; "xcb-imdkit-0.3.0" = "sha256-fTpJ6uNhjmCWv7dZqVgYuS2Uic36XNYTbqlaly5QBjI=";
}; };
}; };
patches = (old.patches or [ ]) ++ [ patches =
(old.patches or [])
++ [
(pkgs.fetchpatch { (pkgs.fetchpatch {
# fix(wayland): ensure repaint event is sent in show # fix(wayland): ensure repaint event is sent in show
url = "https://patch-diff.githubusercontent.com/raw/wez/wezterm/pull/5264.patch"; url = "https://patch-diff.githubusercontent.com/raw/wez/wezterm/pull/5264.patch";
hash = "sha256-c+frVaBEL0h3PJvNu3AW2iap+uUXBY8olbm7Wsxuh4Q="; hash = "sha256-c+frVaBEL0h3PJvNu3AW2iap+uUXBY8olbm7Wsxuh4Q=";
}) })
(pkgs.writeText "wezterm-remove_capabilities.patch" '' (pkgs.writeText
"wezterm-remove_capabilities.patch"
''
diff --git a/window/src/os/wayland/seat.rs b/window/src/os/wayland/seat.rs diff --git a/window/src/os/wayland/seat.rs b/window/src/os/wayland/seat.rs
index 3798f4259..e91591130 100644 index 3798f4259..e91591130 100644
--- a/window/src/os/wayland/seat.rs --- a/window/src/os/wayland/seat.rs
@ -56,8 +60,7 @@
'') '')
]; ];
})) }))
else else pkgs.wezterm;
pkgs.wezterm;
extraConfig = '' extraConfig = ''
return { return {

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = [pkgs.whatsapp-for-linux]; home.packages = [pkgs.whatsapp-for-linux];
systemd.user.services.whatsapp = { systemd.user.services.whatsapp = {

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = with pkgs; [ home.packages = with pkgs; [
winetricks winetricks
wineWowPackages.waylandFull wineWowPackages.waylandFull

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
xdg = { xdg = {
enable = true; enable = true;
mimeApps.enable = true; mimeApps.enable = true;
@ -21,11 +20,7 @@
genericName = "Firefox protocol"; genericName = "Firefox protocol";
exec = "firefox -- %U"; exec = "firefox -- %U";
terminal = false; terminal = false;
mimeType = [ mimeType = ["text/html" "text/xml" "text/uri"];
"text/html"
"text/xml"
"text/uri"
];
}; };
}; };
}; };

View file

@ -2,15 +2,11 @@
pkgs, pkgs,
lib, lib,
... ...
}: }: {
{
home.packages = [pkgs.zmkBATx]; home.packages = [pkgs.zmkBATx];
systemd.user.services.zmkBATx = { systemd.user.services.zmkBATx = {
Install.WantedBy = [ Install.WantedBy = ["graphical-session.target" "waybar.service"];
"graphical-session.target"
"waybar.service"
];
Unit = { Unit = {
Description = "zmkBATx"; Description = "zmkBATx";

View file

@ -1,4 +1,3 @@
{ pkgs, ... }: {pkgs, ...}: {
{
home.packages = [pkgs.zulip]; home.packages = [pkgs.zulip];
} }

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
environment.systemPackages = [ environment.systemPackages = [
pkgs.vim pkgs.vim
]; ];

View file

@ -1,8 +1,9 @@
{ {
fleetModules, fleetModules,
pkgs,
lib,
... ...
}: }: {
{
imports = imports =
[ [
./hardware-configuration.nix ./hardware-configuration.nix

View file

@ -7,19 +7,12 @@
pkgs, pkgs,
modulesPath, modulesPath,
... ...
}: }: {
{
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "usb_storage" "usbhid" "sd_mod"];
"ahci"
"xhci_pci"
"usb_storage"
"usbhid"
"sd_mod"
];
boot.initrd.kernelModules = []; boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"]; boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = []; boot.extraModulePackages = [];

View file

@ -1,8 +1,10 @@
{ {
self,
lib,
config,
inputs, inputs,
... ...
}: }: {
{
imports = [./module.nix]; imports = [./module.nix];
fleet = { fleet = {
@ -72,8 +74,7 @@
# }; # };
deltaflyer = { deltaflyer = {
nixpkgs = nixpkgs = let
let
# keep in sync with https://github.com/NixOS/mobile-nixos/blob/development/pkgs.nix # keep in sync with https://github.com/NixOS/mobile-nixos/blob/development/pkgs.nix
rev = "44d0940ea560dee511026a53f0e2e2cde489b4d4"; rev = "44d0940ea560dee511026a53f0e2e2cde489b4d4";
in in

View file

@ -3,8 +3,7 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: {
{
imports = imports =
fleetModules [ fleetModules [
"common" "common"
@ -42,10 +41,7 @@
# Networking, modem and misc. # Networking, modem and misc.
{ {
# Ensures any rndis config from stage-1 is not clobbered by NetworkManager # Ensures any rndis config from stage-1 is not clobbered by NetworkManager
networking.networkmanager.unmanaged = [ networking.networkmanager.unmanaged = ["rndis0" "usb0"];
"rndis0"
"usb0"
];
# Setup USB gadget networking in initrd... # Setup USB gadget networking in initrd...
mobile.boot.stage-1.networking.enable = lib.mkDefault true; mobile.boot.stage-1.networking.enable = lib.mkDefault true;
@ -85,8 +81,7 @@
{ {
system.stateVersion = "24.11"; system.stateVersion = "24.11";
nixpkgs.config.allowUnfreePredicate = nixpkgs.config.allowUnfreePredicate = pkg:
pkg:
builtins.elem (lib.getName pkg) [ builtins.elem (lib.getName pkg) [
"oneplus-sdm845-firmware-zstd" "oneplus-sdm845-firmware-zstd"
"oneplus-sdm845-firmware-xz" "oneplus-sdm845-firmware-xz"
@ -111,8 +106,7 @@
bind = $mod, r, exec, rotate-screen hor bind = $mod, r, exec, rotate-screen hor
bind = $mod SHIFT, r, exec, rotate-screen ver bind = $mod SHIFT, r, exec, rotate-screen ver
''; '';
home.packages = home.packages = let
let
rotateScript = pkgs.writeShellApplication { rotateScript = pkgs.writeShellApplication {
name = "rotate-screen"; name = "rotate-screen";
runtimeInputs = [pkgs.hyprland]; runtimeInputs = [pkgs.hyprland];
@ -126,8 +120,7 @@
fi fi
''; '';
}; };
in in [rotateScript];
[ rotateScript ];
services.swayidle.enable = lib.mkForce false; services.swayidle.enable = lib.mkForce false;
} }
]; ];
@ -145,13 +138,7 @@
zramSwap.enable = lib.mkDefault true; zramSwap.enable = lib.mkDefault true;
boot.binfmt.emulatedSystems = lib.mkForce [ boot.binfmt.emulatedSystems = lib.mkForce ["x86_64-linux" "i686-linux" "i386-linux" "i486-linux" "i586-linux"];
"x86_64-linux"
"i686-linux"
"i386-linux"
"i486-linux"
"i586-linux"
];
} }
]; ];
} }

View file

@ -2,10 +2,11 @@
# Minimum config used to enable Plasma Mobile. # Minimum config used to enable Plasma Mobile.
# #
{ {
config,
lib, lib,
pkgs,
... ...
}: }: {
{
mobile.beautification = { mobile.beautification = {
silentBoot = lib.mkDefault false; silentBoot = lib.mkDefault false;
splash = lib.mkDefault false; splash = lib.mkDefault false;

View file

@ -4,8 +4,7 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: {
{
imports = imports =
[ [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
@ -43,16 +42,7 @@
}; };
fonts = { fonts = {
fonts = with pkgs; [ fonts = with pkgs; [powerline-fonts dejavu_fonts fira-code fira-code-symbols emacs-all-the-icons-fonts nerdfonts joypixels etBook];
powerline-fonts
dejavu_fonts
fira-code
fira-code-symbols
emacs-all-the-icons-fonts
nerdfonts
joypixels
etBook
];
fontconfig.defaultFonts = { fontconfig.defaultFonts = {
monospace = ["DejaVu Sans Mono for Powerline"]; monospace = ["DejaVu Sans Mono for Powerline"];
sansSerif = ["DejaVu Sans"]; sansSerif = ["DejaVu Sans"];
@ -62,10 +52,7 @@
nixpkgs.config.joypixels.acceptLicense = true; nixpkgs.config.joypixels.acceptLicense = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [waypipe firefox];
waypipe
firefox
];
programs.mosh.enable = true; programs.mosh.enable = true;

View file

@ -3,8 +3,7 @@
lib, lib,
disks ? ["/dev/sda"], disks ? ["/dev/sda"],
... ...
}: }: {
{
disk = lib.genAttrs disks (dev: { disk = lib.genAttrs disks (dev: {
device = dev; device = dev;
type = "disk"; type = "disk";

View file

@ -4,8 +4,7 @@
lib, lib,
config, config,
... ...
}: }: {
{
imports = imports =
[ [
./hardware-configuration.nix ./hardware-configuration.nix
@ -262,8 +261,7 @@
}; };
}; };
systemd.services.ydns = systemd.services.ydns = let
let
ydnsUpdater = pkgs.writeScriptBin "ydnsUpdater" '' ydnsUpdater = pkgs.writeScriptBin "ydnsUpdater" ''
USER="andrea.ciceri@autistici.org" USER="andrea.ciceri@autistici.org"
PASSWORD=$(cat /home/ccr/.ydns-password) PASSWORD=$(cat /home/ccr/.ydns-password)
@ -275,8 +273,7 @@
done done
${pkgs.curl}/bin/curl --basic -u "$USER:$PASSWORD" --silent https://ydns.io/api/v1/update/?host=$DOMAIN ${pkgs.curl}/bin/curl --basic -u "$USER:$PASSWORD" --silent https://ydns.io/api/v1/update/?host=$DOMAIN
''; '';
in in {
{
description = "YDNS IP updater"; description = "YDNS IP updater";
wantedBy = ["multi-user.target"]; wantedBy = ["multi-user.target"];
after = ["network.target"]; after = ["network.target"];

View file

@ -1,14 +1,6 @@
{ lib, ... }: {lib, ...}: {
{
boot = { boot = {
initrd.availableKernelModules = [ initrd.availableKernelModules = ["ohci_pci" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"];
"ohci_pci"
"ehci_pci"
"ahci"
"usb_storage"
"usbhid"
"sd_mod"
];
loader.grub = lib.mkForce { loader.grub = lib.mkForce {
enable = true; enable = true;
version = 2; version = 2;

View file

@ -1,15 +1,14 @@
{ {
config, config,
lib,
pkgs, pkgs,
fleetFlake, fleetFlake,
... ...
}: }: let
let
sshdTmpDirectory = "${config.user.home}/sshd-tmp"; sshdTmpDirectory = "${config.user.home}/sshd-tmp";
sshdDirectory = "${config.user.home}/sshd"; sshdDirectory = "${config.user.home}/sshd";
port = 8022; port = 8022;
in in {
{
# Backup etc files instead of failing to activate generation if a file already exists in /etc # Backup etc files instead of failing to activate generation if a file already exists in /etc
environment.etcBackupExtension = ".bak"; environment.etcBackupExtension = ".bak";
@ -24,9 +23,7 @@ in
# Set your time zone # Set your time zone
time.timeZone = "Europe/Rome"; time.timeZone = "Europe/Rome";
home-manager.config = home-manager.config = {pkgs, ...}: {
{ ... }:
{
home.stateVersion = "24.05"; home.stateVersion = "24.05";
_module.args = { _module.args = {
hostname = "janeway"; hostname = "janeway";
@ -35,12 +32,10 @@ in
imports = [../../hmModules/shell]; imports = [../../hmModules/shell];
}; };
build.activation.sshd = build.activation.sshd = let
let
keys = (builtins.import ../../lib).keys; keys = (builtins.import ../../lib).keys;
inherit (keys) hosts users; inherit (keys) hosts users;
in in ''
''
$DRY_RUN_CMD mkdir $VERBOSE_ARG --parents "${config.user.home}/.ssh" $DRY_RUN_CMD mkdir $VERBOSE_ARG --parents "${config.user.home}/.ssh"
$DRY_RUN_CMD echo ${hosts.picard} > "${config.user.home}/.ssh/authorized_keys" $DRY_RUN_CMD echo ${hosts.picard} > "${config.user.home}/.ssh/authorized_keys"
$DRY_RUN_CMD echo ${hosts.sisko} >> "${config.user.home}/.ssh/authorized_keys" $DRY_RUN_CMD echo ${hosts.sisko} >> "${config.user.home}/.ssh/authorized_keys"
@ -62,11 +57,9 @@ in
fi fi
''; '';
environment.packages = environment.packages = let
let
inherit (fleetFlake.inputs.ccrEmacs.packages.aarch64-linux) ccrEmacs; inherit (fleetFlake.inputs.ccrEmacs.packages.aarch64-linux) ccrEmacs;
in in [
[
pkgs.bottom pkgs.bottom
pkgs.helix pkgs.helix
pkgs.stress pkgs.stress

View file

@ -1,10 +1,10 @@
{ {
fleetModules, fleetModules,
lib, lib,
pkgs,
config, config,
... ...
}: }: {
{
imports = imports =
fleetModules [ fleetModules [
"common" "common"
@ -47,6 +47,7 @@
"helix" "helix"
"shell" "shell"
"element" "element"
"emacs"
"firefox" "firefox"
"gpg" "gpg"
"mpv" "mpv"

View file

@ -8,17 +8,12 @@
config, config,
inputs, inputs,
... ...
}: } @ flakePartsArgs: let
let
cfg = config.fleet; cfg = config.fleet;
in in {
{
options.fleet = { options.fleet = {
darwinHosts = lib.mkOption { darwinHosts = lib.mkOption {
type = lib.types.attrsOf ( type = lib.types.attrsOf (lib.types.submodule ({name, ...}: {
lib.types.submodule (
{ name, ... }:
{
options = { options = {
name = lib.mkOption { name = lib.mkOption {
description = "Host name"; description = "Host name";
@ -42,26 +37,19 @@ in
}; };
overlays = lib.mkOption { overlays = lib.mkOption {
description = "Enabled Nixpkgs overlays"; description = "Enabled Nixpkgs overlays";
type = lib.types.listOf ( type = lib.types.listOf (lib.mkOptionType {
lib.mkOptionType {
name = "nixpkgs-overlay"; name = "nixpkgs-overlay";
description = "nixpkgs overlay"; description = "nixpkgs overlay";
check = lib.isFunction; check = lib.isFunction;
merge = lib.mergeOneOption; merge = lib.mergeOneOption;
} });
);
default = []; default = [];
}; };
}; };
} }));
)
);
}; };
nixOnDroidHosts = lib.mkOption { nixOnDroidHosts = lib.mkOption {
type = lib.types.attrsOf ( type = lib.types.attrsOf (lib.types.submodule ({name, ...}: {
lib.types.submodule (
{ name, ... }:
{
options = { options = {
name = lib.mkOption { name = lib.mkOption {
description = "Host name"; description = "Host name";
@ -85,27 +73,20 @@ in
}; };
overlays = lib.mkOption { overlays = lib.mkOption {
description = "Enabled Nixpkgs overlays"; description = "Enabled Nixpkgs overlays";
type = lib.types.listOf ( type = lib.types.listOf (lib.mkOptionType {
lib.mkOptionType {
name = "nixpkgs-overlay"; name = "nixpkgs-overlay";
description = "nixpkgs overlay"; description = "nixpkgs overlay";
check = lib.isFunction; check = lib.isFunction;
merge = lib.mergeOneOption; merge = lib.mergeOneOption;
} });
);
default = []; default = [];
}; };
}; };
} }));
)
);
}; };
hosts = lib.mkOption { hosts = lib.mkOption {
description = "Host configuration"; description = "Host configuration";
type = lib.types.attrsOf ( type = lib.types.attrsOf (lib.types.submodule ({name, ...}: {
lib.types.submodule (
{ name, ... }:
{
options = { options = {
name = lib.mkOption { name = lib.mkOption {
description = "Host name"; description = "Host name";
@ -139,10 +120,7 @@ in
}; };
secrets = lib.mkOption { secrets = lib.mkOption {
description = "List of secrets names in the `secrets` folder"; description = "List of secrets names in the `secrets` folder";
type = lib.types.attrsOf ( type = lib.types.attrsOf (lib.types.submodule ({name, ...}: {
lib.types.submodule (
{ name, ... }:
{
options = { options = {
owner = lib.mkOption { owner = lib.mkOption {
type = lib.types.str; type = lib.types.str;
@ -162,9 +140,7 @@ in
default = "0440"; default = "0440";
}; };
}; };
} }));
)
);
default = {}; default = {};
}; };
enableHomeManager = lib.mkOption { enableHomeManager = lib.mkOption {
@ -174,14 +150,12 @@ in
}; };
overlays = lib.mkOption { overlays = lib.mkOption {
description = "Enabled Nixpkgs overlays"; description = "Enabled Nixpkgs overlays";
type = lib.types.listOf ( type = lib.types.listOf (lib.mkOptionType {
lib.mkOptionType {
name = "nixpkgs-overlay"; name = "nixpkgs-overlay";
description = "nixpkgs overlay"; description = "nixpkgs overlay";
check = lib.isFunction; check = lib.isFunction;
merge = lib.mergeOneOption; merge = lib.mergeOneOption;
} });
);
default = []; default = [];
}; };
extraModules = lib.mkOption { extraModules = lib.mkOption {
@ -201,14 +175,11 @@ in
}; };
}; };
config.overlays = with inputs; cfg.overlays; config.overlays = with inputs; cfg.overlays;
} }));
)
);
default = {}; default = {};
}; };
vpnExtra = lib.mkOption { vpnExtra = lib.mkOption {
type = lib.types.attrsOf ( type = lib.types.attrsOf (lib.types.submodule {
lib.types.submodule {
options = { options = {
ip = lib.mkOption { ip = lib.mkOption {
description = "Wireguard VPN ip"; description = "Wireguard VPN ip";
@ -219,69 +190,56 @@ in
type = lib.types.str; type = lib.types.str;
}; };
}; };
} });
);
default = {}; default = {};
}; };
_mkNixosConfiguration = lib.mkOption { _mkNixosConfiguration = lib.mkOption {
description = "Function returning a proper NixOS configuration"; description = "Function returning a proper NixOS configuration";
type = lib.types.functionTo (lib.types.functionTo lib.types.attrs); # TODO improve this type type = lib.types.functionTo (lib.types.functionTo lib.types.attrs); # TODO improve this type
internal = true; internal = true;
default = default = hostname: config:
hostname: config:
config.nixpkgs.lib.nixosSystem { config.nixpkgs.lib.nixosSystem {
inherit (config) system; inherit (config) system;
modules = modules =
[ [
( ({lib, ...}: {
{ lib, ... }:
{
networking.hostName = lib.mkForce hostname; networking.hostName = lib.mkForce hostname;
nixpkgs.overlays = config.overlays; nixpkgs.overlays = config.overlays;
} })
)
"${self.outPath}/hosts/${hostname}" "${self.outPath}/hosts/${hostname}"
] ]
++ (lib.optionals (config.secrets != []) [ ++ (lib.optionals (config.secrets != []) [
inputs.agenix.nixosModules.default inputs.agenix.nixosModules.default
( ({lib, ...}: let
{ lib, ... }:
let
allSecrets = lib.mapAttrs' (name: value: { allSecrets = lib.mapAttrs' (name: value: {
name = lib.removeSuffix ".age" name; name = lib.removeSuffix ".age" name;
inherit value; inherit value;
}) (import "${self.outPath}/secrets/secrets.nix"); }) (import "${self.outPath}/secrets/secrets.nix");
filteredSecrets = lib.filterAttrs (name: _: builtins.hasAttr name config.secrets) allSecrets; filteredSecrets =
in lib.filterAttrs
{ (name: _: builtins.hasAttr name config.secrets)
age.secrets = lib.mapAttrs' (name: _: { allSecrets;
in {
age.secrets =
lib.mapAttrs' (name: _: {
name = builtins.baseNameOf name; name = builtins.baseNameOf name;
value = { value = {
inherit (config.secrets.${name}) inherit (config.secrets.${name}) owner group file mode;
owner
group
file
mode
;
}; };
}) filteredSecrets; })
} filteredSecrets;
) })
]) ])
++ (lib.optionals config.enableHomeManager ( ++ (lib.optionals config.enableHomeManager (let
let
user = config.extraHmModulesUser; user = config.extraHmModulesUser;
extraHmModules = config.extraHmModules; extraHmModules = config.extraHmModules;
in in [
[
config.homeManager.nixosModule config.homeManager.nixosModule
( ({
{
config, config,
pkgs, pkgs,
... ...
}: }: {
{
home-manager.users."${user}" = { home-manager.users."${user}" = {
imports = extraHmModules; imports = extraHmModules;
_module.args = { _module.args = {
@ -290,10 +248,8 @@ in
pkgsStable = inputs.nixpkgsStable.legacyPackages.${pkgs.system}; pkgsStable = inputs.nixpkgsStable.legacyPackages.${pkgs.system};
}; };
}; };
} })
) ]))
]
))
++ config.extraModules; ++ config.extraModules;
specialArgs = { specialArgs = {
fleetModules = builtins.map (moduleName: "${self.outPath}/modules/${moduleName}"); fleetModules = builtins.map (moduleName: "${self.outPath}/modules/${moduleName}");
@ -307,21 +263,18 @@ in
description = "Function returning a proper Darwin configuration"; description = "Function returning a proper Darwin configuration";
type = lib.types.functionTo (lib.types.functionTo lib.types.attrs); # TODO improve this type type = lib.types.functionTo (lib.types.functionTo lib.types.attrs); # TODO improve this type
internal = true; internal = true;
default = default = hostname: config:
hostname: config:
inputs.nixDarwin.lib.darwinSystem { inputs.nixDarwin.lib.darwinSystem {
modules = [ modules = [
( ({
{
lib, lib,
pkgs,
... ...
}: }: {
{
networking.hostName = lib.mkForce hostname; networking.hostName = lib.mkForce hostname;
nixpkgs.overlays = config.overlays; nixpkgs.overlays = config.overlays;
nixpkgs.hostPlatform = config.system; nixpkgs.hostPlatform = config.system;
} })
)
"${self.outPath}/hosts/${hostname}" "${self.outPath}/hosts/${hostname}"
]; ];
}; };
@ -331,20 +284,18 @@ in
description = "Function returning a proper nix-on-droid configuration"; description = "Function returning a proper nix-on-droid configuration";
type = lib.types.functionTo (lib.types.functionTo lib.types.attrs); # TODO improve this type type = lib.types.functionTo (lib.types.functionTo lib.types.attrs); # TODO improve this type
internal = true; internal = true;
default = default = hostname: config:
hostname: config:
inputs.nix-on-droid.lib.nixOnDroidConfiguration { inputs.nix-on-droid.lib.nixOnDroidConfiguration {
pkgs = inputs.nixpkgs.legacyPackages.aarch64-linux; pkgs = inputs.nixpkgs.legacyPackages.aarch64-linux;
modules = [ modules = [
( ({
{ lib,
pkgs,
... ...
}: }: {
{
nixpkgs.overlays = config.overlays; nixpkgs.overlays = config.overlays;
_module.args.fleetFlake = self; _module.args.fleetFlake = self;
} })
)
"${self.outPath}/hosts/${hostname}" "${self.outPath}/hosts/${hostname}"
]; ];
}; };
@ -352,10 +303,19 @@ in
}; };
config = { config = {
flake.nixosConfigurations = lib.mapAttrs config.fleet._mkNixosConfiguration config.fleet.hosts; flake.nixosConfigurations =
lib.mapAttrs
config.fleet._mkNixosConfiguration
config.fleet.hosts;
flake.darwinConfigurations = lib.mapAttrs config.fleet._mkDarwinConfiguration config.fleet.darwinHosts; flake.darwinConfigurations =
lib.mapAttrs
config.fleet._mkDarwinConfiguration
config.fleet.darwinHosts;
flake.nixOnDroidConfigurations = lib.mapAttrs config.fleet._mkNixOnDroidConfiguration config.fleet.nixOnDroidHosts; flake.nixOnDroidConfigurations =
lib.mapAttrs
config.fleet._mkNixOnDroidConfiguration
config.fleet.nixOnDroidHosts;
}; };
} }

View file

@ -5,8 +5,7 @@
pkgs, pkgs,
config, config,
... ...
}: }: {
{
imports = fleetModules [ imports = fleetModules [
"common" "common"
"wireguard-server" "wireguard-server"
@ -58,16 +57,7 @@
}; };
fonts = { fonts = {
fonts = with pkgs; [ fonts = with pkgs; [powerline-fonts dejavu_fonts fira-code fira-code-symbols emacs-all-the-icons-fonts nerdfonts joypixels etBook];
powerline-fonts
dejavu_fonts
fira-code
fira-code-symbols
emacs-all-the-icons-fonts
nerdfonts
joypixels
etBook
];
fontconfig.defaultFonts = { fontconfig.defaultFonts = {
monospace = ["DejaVu Sans Mono for Powerline"]; monospace = ["DejaVu Sans Mono for Powerline"];
sansSerif = ["DejaVu Sans"]; sansSerif = ["DejaVu Sans"];
@ -85,12 +75,7 @@
programs.mosh.enable = true; programs.mosh.enable = true;
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid"];
"xhci_pci"
"ahci"
"nvme"
"usbhid"
];
boot.initrd.kernelModules = []; boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"]; boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = []; boot.extraModulePackages = [];

View file

@ -1,11 +1,8 @@
{ {
disks ? [ lib,
"/dev/nvme0n1" disks ? ["/dev/nvme0n1" "/dev/nvme1n1"],
"/dev/nvme1n1"
],
... ...
}: }: {
{
disk = { disk = {
x = { x = {
type = "disk"; type = "disk";

View file

@ -1,7 +1,9 @@
{ {
config,
lib,
pkgs,
... ...
}: }: {
{
signing.enable = true; signing.enable = true;
# apps.prebuilt = { # apps.prebuilt = {

View file

@ -3,8 +3,7 @@
pkgs, pkgs,
lib, lib,
... ...
}: }: {
{
imports = imports =
[ [
./hardware-configuration.nix ./hardware-configuration.nix

View file

@ -3,8 +3,7 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: {
{
disko.devices = import ./disko.nix {}; disko.devices = import ./disko.nix {};
boot = { boot = {

View file

@ -4,8 +4,7 @@
config, config,
pkgs, pkgs,
... ...
}: }: {
{
imports = imports =
fleetModules [ fleetModules [
"common" "common"

View file

@ -1,10 +1,10 @@
{ {
fleetModules, fleetModules,
pkgs, pkgs,
fleetFlake,
config, config,
... ...
}: }: {
{
imports = imports =
fleetModules [ fleetModules [
"common" "common"
@ -78,15 +78,10 @@
efi.canTouchEfiVariables = false; efi.canTouchEfiVariables = false;
}; };
hardware.deviceTree.enable = true;
hardware.deviceTree.name = "rockchip/rk3588-rock-5b.dtb";
boot.loader.systemd-boot.installDeviceTree = true;
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = [
"nvme" "nvme"
"xhci_pci" "xhci_pci"
"ahci" "ahci"
"usb_storage"
]; ];
boot.kernelParams = [ boot.kernelParams = [

View file

@ -1,18 +1,15 @@
let let
emmc = "/dev/disk/by-id/mmc-SLD64G_0xf6be3ba0";
ssd = "/dev/disk/by-id/ata-CT240BX300SSD1_1739E1042F3C"; ssd = "/dev/disk/by-id/ata-CT240BX300SSD1_1739E1042F3C";
in
# hd1 = "/dev/disk/by-id/ata-WDC_WD10EADS-22M2B0_WD-WCAV52709550"; # hd1 = "/dev/disk/by-id/ata-WDC_WD10EADS-22M2B0_WD-WCAV52709550";
# hd2 = "/dev/disk/by-id/ata-WDC_WD10EADX-22TDHB0_WD-WCAV5V359530"; # hd2 = "/dev/disk/by-id/ata-WDC_WD10EADX-22TDHB0_WD-WCAV5V359530";
hd = "/dev/disk/by-id/ata-WDC_WD10EADS-22M2B0_WD-WCAV52709550-part1";
# old_hd = "/dev/disk/by-id/ata-WDC_WD5000AAKX-08U6AA0_WD-WCC2E5TR40FU"; # old_hd = "/dev/disk/by-id/ata-WDC_WD5000AAKX-08U6AA0_WD-WCC2E5TR40FU";
{ in {
disko.devices = { disko.devices = {
nodev."/" = { nodev."/" = {
fsType = "tmpfs"; fsType = "tmpfs";
mountOptions = [ mountOptions = ["size=1024M" "defaults" "mode=755"];
"size=1024M"
"defaults"
"mode=755"
];
}; };
disk = { disk = {
ssd = { ssd = {

View file

@ -1,8 +1,10 @@
{ {
fleetModules, fleetModules,
lib,
config,
pkgs,
... ...
}: }: {
{
imports = imports =
fleetModules [ fleetModules [
"common" "common"

View file

@ -1,10 +1,10 @@
{ {
config, config,
lib,
pkgs, pkgs,
fleetModules, fleetModules,
... ...
}: }: {
{
imports = imports =
[ [
./zfs.nix ./zfs.nix
@ -97,12 +97,7 @@
]; ];
}; };
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod"];
"xhci_pci"
"nvme"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = []; boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"]; boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = with config.boot.kernelPackages; [v4l2loopback]; boot.extraModulePackages = with config.boot.kernelPackages; [v4l2loopback];

View file

@ -4,20 +4,15 @@
{ {
config, config,
lib, lib,
pkgs,
modulesPath, modulesPath,
... ...
}: }: {
{
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod"];
"xhci_pci"
"nvme"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = []; boot.initrd.kernelModules = [];
boot.kernelModules = ["uinput"]; boot.kernelModules = ["uinput"];
boot.extraModulePackages = []; boot.extraModulePackages = [];
@ -25,46 +20,31 @@
fileSystems."/" = { fileSystems."/" = {
device = "rpool/nixos/root"; device = "rpool/nixos/root";
fsType = "zfs"; fsType = "zfs";
options = [ options = ["zfsutil" "X-mount.mkdir"];
"zfsutil"
"X-mount.mkdir"
];
}; };
fileSystems."/home" = { fileSystems."/home" = {
device = "rpool/nixos/home"; device = "rpool/nixos/home";
fsType = "zfs"; fsType = "zfs";
options = [ options = ["zfsutil" "X-mount.mkdir"];
"zfsutil"
"X-mount.mkdir"
];
}; };
fileSystems."/var/lib" = { fileSystems."/var/lib" = {
device = "rpool/nixos/var/lib"; device = "rpool/nixos/var/lib";
fsType = "zfs"; fsType = "zfs";
options = [ options = ["zfsutil" "X-mount.mkdir"];
"zfsutil"
"X-mount.mkdir"
];
}; };
fileSystems."/var/log" = { fileSystems."/var/log" = {
device = "rpool/nixos/var/log"; device = "rpool/nixos/var/log";
fsType = "zfs"; fsType = "zfs";
options = [ options = ["zfsutil" "X-mount.mkdir"];
"zfsutil"
"X-mount.mkdir"
];
}; };
fileSystems."/boot" = { fileSystems."/boot" = {
device = "bpool/nixos/root"; device = "bpool/nixos/root";
fsType = "zfs"; fsType = "zfs";
options = [ options = ["zfsutil" "X-mount.mkdir"];
"zfsutil"
"X-mount.mkdir"
];
}; };
fileSystems."/boot/efis/nvme-INTEL_SSDPEKKF010T8L_PHHP938405741P0D-part1" = { fileSystems."/boot/efis/nvme-INTEL_SSDPEKKF010T8L_PHHP938405741P0D-part1" = {

View file

@ -1,9 +1,9 @@
{ {
config,
pkgs, pkgs,
lib, lib,
... ...
}: }: {
{
boot.supportedFilesystems = ["zfs"]; boot.supportedFilesystems = ["zfs"];
networking.hostId = "adf0b5e7"; networking.hostId = "adf0b5e7";
boot.loader.efi.efiSysMountPoint = "/boot/efi"; boot.loader.efi.efiSysMountPoint = "/boot/efi";

View file

@ -6,9 +6,6 @@
openFirewall = true; openFirewall = true;
}; };
}; };
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [3000 53];
3000
53
];
networking.firewall.allowedUDPPorts = [53]; networking.firewall.allowedUDPPorts = [53];
} }

View file

@ -1,5 +1,4 @@
{ config, ... }: {config, ...}: {
{
services.atuin = { services.atuin = {
enable = true; enable = true;
openFirewall = false; # use only in the VPN openFirewall = false; # use only in the VPN

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
sound.enable = true; sound.enable = true;
hardware.pulseaudio = { hardware.pulseaudio = {

View file

@ -1,8 +1,9 @@
{ {
config, config,
options,
lib,
... ...
}: }: {
{
system.autoUpgrade = { system.autoUpgrade = {
enable = false; enable = false;
flake = "github:aciceri/nixfleet#${config.networking.hostName}"; flake = "github:aciceri/nixfleet#${config.networking.hostName}";

View file

@ -1,11 +1,10 @@
{ config, ... }: {config, ...}: {
{
services.tlp.enable = true; services.tlp.enable = true;
services.upower.enable = true; services.upower.enable = true;
nixpkgs.overlays = [ nixpkgs.overlays = [
(_self: super: { (self: super: {
tlp = super.tlp.override { tlp = super.tlp.override {
enableRDW = config.networkmanager.enable; enableRDW = config.networkmanager.enable;
}; };

View file

@ -1,9 +1,5 @@
{ {
boot.binfmt.emulatedSystems = [ boot.binfmt.emulatedSystems = ["i686-linux" "aarch64-linux" "riscv64-linux"];
"i686-linux"
"aarch64-linux"
"riscv64-linux"
];
nix.extraOptions = '' nix.extraOptions = ''
extra-platforms = aarch64-linux arm-linux i686-linux riscv64-linux extra-platforms = aarch64-linux arm-linux i686-linux riscv64-linux
''; '';

View file

@ -2,8 +2,7 @@
pkgs, pkgs,
config, config,
... ...
}: }: {
{
services.blueman.enable = true; services.blueman.enable = true;
hardware.pulseaudio.enable = true; hardware.pulseaudio.enable = true;
hardware.bluetooth = { hardware.bluetooth = {

View file

@ -3,10 +3,7 @@
bubbleupnpserver = { bubbleupnpserver = {
image = "bubblesoftapps/bubbleupnpserver"; image = "bubblesoftapps/bubbleupnpserver";
ports = ["58050:58050"]; ports = ["58050:58050"];
extraOptions = [ extraOptions = ["--network=host" "-device /dev/dri:/dev/dri"];
"--network=host"
"-device /dev/dri:/dev/dri"
];
}; };
}; };

View file

@ -7,12 +7,10 @@
vpn, vpn,
options, options,
... ...
}: }: let
let
cfg = config.ccr; cfg = config.ccr;
inherit (lib) types; inherit (lib) types;
in in {
{
options.ccr = { options.ccr = {
enable = lib.mkEnableOption "ccr"; enable = lib.mkEnableOption "ccr";
@ -72,27 +70,14 @@ in
}; };
}; };
config = lib.mkIf cfg.enable ( config = lib.mkIf cfg.enable (lib.mkMerge [
lib.mkMerge [
(lib.optionalAttrs (builtins.hasAttr "backup" options) { (lib.optionalAttrs (builtins.hasAttr "backup" options) {
backup.paths = cfg.backupPaths; backup.paths = cfg.backupPaths;
}) })
{ {
# FIXME shouldn't set these groups by default # FIXME shouldn't set these groups by default
ccr.extraGroups = [ ccr.extraGroups = ["wheel" "fuse" "video" "dialout" "systemd-journal" "camera"];
"wheel" ccr.modules = ["shell" "git" "nix-index" "btop"];
"fuse"
"video"
"dialout"
"systemd-journal"
"camera"
];
ccr.modules = [
"shell"
"git"
"nix-index"
"btop"
];
users.users.${cfg.username} = { users.users.${cfg.username} = {
inherit (config.ccr) hashedPassword extraGroups description; inherit (config.ccr) hashedPassword extraGroups description;
@ -104,7 +89,10 @@ in
programs.fish.enable = true; programs.fish.enable = true;
services.getty.autologinUser = if config.ccr.autologin then cfg.username else null; services.getty.autologinUser =
if config.ccr.autologin
then cfg.username
else null;
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
@ -126,6 +114,5 @@ in
home.stateVersion = config.system.stateVersion; home.stateVersion = config.system.stateVersion;
}; };
} }
] ]);
);
} }

View file

@ -1,15 +1,13 @@
{ {
lib,
pkgs, pkgs,
... ...
}: }: let
let
repos-path = "/var/lib/cgit-repos"; repos-path = "/var/lib/cgit-repos";
cgit-setup-repos = cgit-setup-repos =
pkgs.writers.writePython3 "cgit-setup-repos" pkgs.writers.writePython3 "cgit-setup-repos" {
{
libraries = with pkgs.python3Packages; [PyGithub]; libraries = with pkgs.python3Packages; [PyGithub];
} } ''
''
from github import Github from github import Github
from pathlib import Path from pathlib import Path
@ -24,8 +22,7 @@ let
f"repo.desc={repo.description}\n" f"repo.desc={repo.description}\n"
]) ])
''; '';
in in {
{
services.nginx.virtualHosts."git.aciceri.dev" = { services.nginx.virtualHosts."git.aciceri.dev" = {
cgit = { cgit = {
enable = true; enable = true;
@ -34,12 +31,10 @@ in
virtual-root = "/"; virtual-root = "/";
cache-size = 1000; cache-size = 1000;
include = [ include = [
(builtins.toString ( (builtins.toString (pkgs.writeText "cgit-extra" ''
pkgs.writeText "cgit-extra" ''
source-filter=${pkgs.cgit-pink}/lib/cgit/filters/syntax-highlighting.py source-filter=${pkgs.cgit-pink}/lib/cgit/filters/syntax-highlighting.py
about-filter=${pkgs.cgit-pink}/lib/cgit/filters/about-formatting.sh about-filter=${pkgs.cgit-pink}/lib/cgit/filters/about-formatting.sh
'' ''))
))
repos-path repos-path
]; ];
}; };

View file

@ -4,42 +4,33 @@
pkgs, pkgs,
... ...
}: }:
with lib; with lib; let
let
globalConfig = config; globalConfig = config;
settingsFormat = { settingsFormat = {
type = type = with lib.types; let
with lib.types;
let
value = value =
oneOf [ oneOf [int str]
int
str
]
// { // {
description = "INI-like atom (int or string)"; description = "INI-like atom (int or string)";
}; };
values = coercedTo value lib.singleton (listOf value) // { values =
coercedTo value lib.singleton (listOf value)
// {
description = value.description + " or a list of them for duplicate keys"; description = value.description + " or a list of them for duplicate keys";
}; };
in in
attrsOf values; attrsOf values;
generate = generate = name: values:
name: values:
pkgs.writeText name (lib.generators.toKeyValue {listsAsDuplicateKeys = true;} values); pkgs.writeText name (lib.generators.toKeyValue {listsAsDuplicateKeys = true;} values);
}; };
in in {
{
imports = [ imports = [
../nginx-base ../nginx-base
./config.nix ./config.nix
]; ];
options.services.nginx.virtualHosts = mkOption { options.services.nginx.virtualHosts = mkOption {
type = types.attrsOf ( type = types.attrsOf (types.submodule ({config, ...}: let
types.submodule (
{ config, ... }:
let
cfg = config.cgit; cfg = config.cgit;
# These are the global options for this submodule, but for nicer UX they # These are the global options for this submodule, but for nicer UX they
@ -59,8 +50,7 @@ in
# Remove the global options for serialization into cgitrc # Remove the global options for serialization into cgitrc
settings = removeAttrs cfg (attrNames options); settings = removeAttrs cfg (attrNames options);
in in {
{
options.cgit = mkOption { options.cgit = mkOption {
type = types.submodule { type = types.submodule {
freeformType = settingsFormat.type; freeformType = settingsFormat.type;
@ -97,8 +87,7 @@ in
''; '';
}; };
config = config = let
let
location = removeSuffix "/" cfg.location; location = removeSuffix "/" cfg.location;
in in
mkIf cfg.enable { mkIf cfg.enable {
@ -123,25 +112,21 @@ in
fastcgi_pass unix:${globalConfig.services.fcgiwrap.socketAddress}; fastcgi_pass unix:${globalConfig.services.fcgiwrap.socketAddress};
'' ''
+ ( + (
if cfg.location == "/" then if cfg.location == "/"
'' then ''
fastcgi_param PATH_INFO $uri; fastcgi_param PATH_INFO $uri;
'' ''
else else ''
''
fastcgi_split_path_info ^(${location}/)(/?.+)$; fastcgi_split_path_info ^(${location}/)(/?.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_INFO $fastcgi_path_info;
'' ''
); );
}; };
}; };
} }));
)
);
}; };
config = config = let
let
vhosts = config.services.nginx.virtualHosts; vhosts = config.services.nginx.virtualHosts;
in in
mkIf (any (name: vhosts.${name}.cgit.enable) (attrNames vhosts)) { mkIf (any (name: vhosts.${name}.cgit.enable) (attrNames vhosts)) {

View file

@ -1,5 +1,4 @@
{ config, ... }: {config, ...}: {
{
services.cloudflare-dyndns = { services.cloudflare-dyndns = {
enable = true; enable = true;
ipv4 = true; ipv4 = true;

View file

@ -2,8 +2,7 @@
lib, lib,
fleetModules, fleetModules,
... ...
}: }: {
{
imports = fleetModules [ imports = fleetModules [
"nix" "nix"
"auto-upgrade" "auto-upgrade"

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
services.dbus.packages = [pkgs.dconf]; services.dbus.packages = [pkgs.dconf];
programs.dconf.enable = true; programs.dconf.enable = true;
} }

View file

@ -1,16 +1,13 @@
{ {
pkgs, pkgs,
config,
... ...
}: }: {
{
virtualisation.podman.enable = true; virtualisation.podman.enable = true;
# virtualisation.docker.enable = true; # virtualisation.docker.enable = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
docker-compose docker-compose
podman-compose podman-compose
]; ];
ccr.extraGroups = [ ccr.extraGroups = ["docker" "podman"];
"docker"
"podman"
];
} }

View file

@ -1,19 +1,6 @@
{ pkgs, ... }: {pkgs, ...}: {
{
fonts = { fonts = {
packages = with pkgs; [ packages = with pkgs; [powerline-fonts dejavu_fonts fira-code fira-code-symbols iosevka iosevka-comfy.comfy emacs-all-the-icons-fonts nerdfonts joypixels etBook vegur];
powerline-fonts
dejavu_fonts
fira-code
fira-code-symbols
iosevka
iosevka-comfy.comfy
emacs-all-the-icons-fonts
nerdfonts
joypixels
etBook
vegur
];
fontconfig.defaultFonts = { fontconfig.defaultFonts = {
monospace = ["DejaVu Sans Mono for Powerline"]; monospace = ["DejaVu Sans Mono for Powerline"];
sansSerif = ["DejaVu Sans"]; sansSerif = ["DejaVu Sans"];

View file

@ -4,27 +4,10 @@
pkgs, pkgs,
lib, lib,
... ...
}: }: let
let
storeDeps = pkgs.runCommand "store-deps" {} '' storeDeps = pkgs.runCommand "store-deps" {} ''
mkdir -p $out/bin mkdir -p $out/bin
for dir in ${ for dir in ${with pkgs; builtins.toString [coreutils findutils gnugrep gawk git nix bash jq nodejs nix-fast-build curl tea]}; do
with pkgs;
builtins.toString [
coreutils
findutils
gnugrep
gawk
git
nix
bash
jq
nodejs
nix-fast-build
curl
tea
]
}; do
for bin in "$dir"/bin/*; do for bin in "$dir"/bin/*; do
ln -s "$bin" "$out/bin/$(basename "$bin")" ln -s "$bin" "$out/bin/$(basename "$bin")"
done done
@ -52,12 +35,7 @@ lib.mkMerge [
wantedBy = ["multi-user.target"]; wantedBy = ["multi-user.target"];
after = ["podman.service"]; after = ["podman.service"];
requires = ["podman.service"]; requires = ["podman.service"];
path = [ path = [config.virtualisation.podman.package pkgs.gnutar pkgs.shadow pkgs.getent];
config.virtualisation.podman.package
pkgs.gnutar
pkgs.shadow
pkgs.getent
];
# we also include etc here because the cleanup job also wants the nixuser to be present # we also include etc here because the cleanup job also wants the nixuser to be present
script = '' script = ''
set -eux -o pipefail set -eux -o pipefail
@ -135,9 +113,7 @@ lib.mkMerge [
# }; # };
} }
{ {
systemd.services = systemd.services = lib.genAttrs (builtins.genList (n: "gitea-runner-nix${builtins.toString n}") numInstances) (name: {
lib.genAttrs (builtins.genList (n: "gitea-runner-nix${builtins.toString n}") numInstances)
(_name: {
# TODO: systemd confinment # TODO: systemd confinment
serviceConfig = { serviceConfig = {
# Hardening (may overlap with DynamicUser=) # Hardening (may overlap with DynamicUser=)
@ -181,12 +157,7 @@ lib.mkMerge [
"~setdomainname" "~setdomainname"
"~sethostname" "~sethostname"
]; ];
RestrictAddressFamilies = [ RestrictAddressFamilies = ["AF_INET" "AF_INET6" "AF_UNIX" "AF_NETLINK"];
"AF_INET"
"AF_INET6"
"AF_UNIX"
"AF_NETLINK"
];
# Needs network access # Needs network access
PrivateNetwork = false; PrivateNetwork = false;

View file

@ -1,8 +1,8 @@
{ {
config, config,
pkgs,
... ...
}: }: {
{
services.forgejo = { services.forgejo = {
enable = true; enable = true;
settings = { settings = {

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