This commit is contained in:
xqtc 2024-10-08 11:19:34 +02:00
parent 590734a38b
commit 828989b482
12 changed files with 180 additions and 138 deletions

View file

@ -8,7 +8,7 @@
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
]; ];
sops = { sops = {
defaultSopsFile = ../secrets.yaml; defaultSopsFile = ../secrets.yaml;
validateSopsFiles = false; validateSopsFiles = false;

View file

@ -1,11 +1,11 @@
{inputs, ...}: { {inputs, ...}: {
perSystem = { system, ...}: { perSystem = {system, ...}: {
_module.args.pkgs = import inputs.nixpkgs { _module.args.pkgs = import inputs.nixpkgs {
inherit system; inherit system;
config.allowUnfree = true; config.allowUnfree = true;
# The allowUnfreePredicate is due to home-manager#2942 (I haven't actually checked that it is necessary) # The allowUnfreePredicate is due to home-manager#2942 (I haven't actually checked that it is necessary)
# https://github.com/nix-community/home-manager/issues/2942 # https://github.com/nix-community/home-manager/issues/2942
config.allowUnfreePredicate = (_: true); config.allowUnfreePredicate = _: true;
}; };
}; };
} }

View file

@ -1,21 +1,26 @@
{ lib, flake-parts-lib, ... }: {
let lib,
inherit (lib) flake-parts-lib,
...
}: let
inherit
(lib)
mkOption mkOption
types types
; ;
inherit (flake-parts-lib) inherit
(flake-parts-lib)
mkTransposedPerSystemModule mkTransposedPerSystemModule
; ;
in in
mkTransposedPerSystemModule { mkTransposedPerSystemModule {
name = "homeConfigurations"; name = "homeConfigurations";
option = mkOption { option = mkOption {
type = types.raw; type = types.raw;
default = { }; default = {};
description = '' description = ''
home-manager configs home-manager configs
''; '';
}; };
file = ./hm-flake-part.nix; file = ./hm-flake-part.nix;
} }

View file

@ -1,8 +1,19 @@
{inputs, lib, ...}: { {
inputs,
lib,
...
}: {
imports = [ imports = [
./hm-flake-part.nix ./hm-flake-part.nix
]; ];
perSystem = { config, self', inputs', pkgs, system, ... }: let perSystem = {
config,
self',
inputs',
pkgs,
system,
...
}: let
# split system (e.g. x86_64-linux) into os and arch # split system (e.g. x86_64-linux) into os and arch
splitSystem = lib.splitString "-" system; splitSystem = lib.splitString "-" system;
os = builtins.elemAt splitSystem 0; os = builtins.elemAt splitSystem 0;
@ -14,7 +25,7 @@
../home ../home
inputs.nixvim.homeManagerModules.nixvim inputs.nixvim.homeManagerModules.nixvim
inputs.sops-nix.homeManagerModules.sops inputs.sops-nix.homeManagerModules.sops
{ inherit os arch; } {inherit os arch;}
]; ];
extraSpecialArgs = {inherit inputs;}; extraSpecialArgs = {inherit inputs;};
}; };

View file

@ -1,11 +1,21 @@
{inputs, lib, ...}: { {
flake.nixosConfigurations = lib.genAttrs [ inputs,
"asmodeus" "seraphim" "lilith" "lambda" "beleth" lib,
] (name: inputs.nixpkgs.lib.nixosSystem { ...
system = "x86_64-linux"; }: {
modules = [ flake.nixosConfigurations =
../hosts/x86_64-linux/${name} lib.genAttrs [
]; "asmodeus"
specialArgs = {inherit inputs;}; "seraphim"
}); "lilith"
"lambda"
"beleth"
] (name:
inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
../hosts/x86_64-linux/${name}
];
specialArgs = {inherit inputs;};
});
} }

View file

@ -42,14 +42,22 @@
}; };
#inputs.agenix.url = "github:ryantm/agenix"; #inputs.agenix.url = "github:ryantm/agenix";
outputs = inputs@{ flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } { outputs = inputs @ {flake-parts, ...}:
flake-parts.lib.mkFlake {inherit inputs;} {
imports = [ imports = [
./flake-mods/hm.nix ./flake-mods/hm.nix
./flake-mods/nixosHosts.nix ./flake-mods/nixosHosts.nix
./flake-mods/allowUnfree.nix ./flake-mods/allowUnfree.nix
]; ];
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ]; systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
perSystem = { config, self', inputs', pkgs, system, ... }: {}; perSystem = {
config,
self',
inputs',
pkgs,
system,
...
}: {};
flake = {}; flake = {};
}; };
} }

View file

@ -10,7 +10,10 @@
./system.nix ./system.nix
]; ];
home.username = "xqtc"; home.username = "xqtc";
home.homeDirectory = if config.os == "linux" then "/home/xqtc" else "/Users/xqtc"; home.homeDirectory =
if config.os == "linux"
then "/home/xqtc"
else "/Users/xqtc";
programs.wezterm = { programs.wezterm = {
enable = true; enable = true;

View file

@ -7,7 +7,10 @@
... ...
}: }:
with inputs; { with inputs; {
home.sessionVariables.DEFAULT_BROWSER = if (config.os == "linux") then "${pkgs.firefox}/bin/firefox" else "firefox"; home.sessionVariables.DEFAULT_BROWSER =
if (config.os == "linux")
then "${pkgs.firefox}/bin/firefox"
else "firefox";
programs.firefox = lib.mkIf (config.os == "linux") { programs.firefox = lib.mkIf (config.os == "linux") {
enable = true; enable = true;

View file

@ -9,119 +9,115 @@
maxfetch = pkgs.writeScriptBin "maxfetch" (builtins.readFile ../config-files/maxfetch.sh); maxfetch = pkgs.writeScriptBin "maxfetch" (builtins.readFile ../config-files/maxfetch.sh);
startdwl = pkgs.writeScriptBin "startdwl" (builtins.readFile ../config-files/startdwl.sh); startdwl = pkgs.writeScriptBin "startdwl" (builtins.readFile ../config-files/startdwl.sh);
in { in {
home.packages = (lib.optionals (config.os == "linux") (with pkgs; [ home.packages =
yubioath-flutter (lib.optionals (config.os == "linux") (with pkgs; [
steam yubioath-flutter
heroic steam
protonup-qt heroic
via protonup-qt
telegram-desktop via
jetbrains.rust-rover telegram-desktop
tutanota-desktop jetbrains.rust-rover
bitwarden-desktop tutanota-desktop
bottles bitwarden-desktop
flameshot bottles
grim flameshot
networkmanagerapplet grim
nextcloud-client networkmanagerapplet
swaylock-effects nextcloud-client
wdisplays swaylock-effects
brightnessctl wdisplays
pavucontrol brightnessctl
swayfx pavucontrol
sway-contrib.grimshot swayfx
libnotify sway-contrib.grimshot
swww libnotify
strace swww
ltrace strace
ghidra ltrace
imhex ghidra
qmk-udev-rules imhex
jellyfin-media-player qmk-udev-rules
signal-desktop jellyfin-media-player
# ida-free signal-desktop
# spotify # ida-free
])) ++ (with pkgs; [ # spotify
nh ]))
++ (with pkgs; [
nh
ncspot ncspot
wakatime-cli wakatime-cli
neofetch neofetch
# uwufetch # uwufetch
maxfetch maxfetch
startdwl startdwl
btop btop
iftop iftop
ranger ranger
cargo-mommy cargo-mommy
just just
fzf fzf
catppuccin-kde catppuccin-kde
typst typst
# marked as broken # marked as broken
# anki # anki
freetube freetube
openvpn openvpn
moodle-dl moodle-dl
obsidian
obsidian prismlauncher
# marked as broken
# syncthingtray
rbw
prismlauncher nodejs
# marked as broken # cabal
# syncthingtray ghc
# marked as broken
# rizin
# (cutter.withPlugins (ps: with ps; [jsdec rz-ghidra sigdb]))
rbw nerdfonts
ipafont
vesktop
element-desktop
nodejs qbittorrent
nicotine-plus
# cabal qmk
ghc
# marked as broken neovide
# rizin
# (cutter.withPlugins (ps: with ps; [jsdec rz-ghidra sigdb]))
xournalpp
zathura
nerdfonts ripgrep
ipafont
vesktop sayonara
element-desktop # mpv
feishin
qbittorrent nix-tree
nicotine-plus
qmk nixos-icons
]);
neovide
xournalpp
zathura
ripgrep
sayonara
# mpv
feishin
nix-tree
nixos-icons
]);
} }

View file

@ -5,7 +5,10 @@
... ...
}: { }: {
programs = { programs = {
zsh.enable = if config.os == "linux" then true else false; zsh.enable =
if config.os == "linux"
then true
else false;
atuin = { atuin = {
enable = true; enable = true;
enableNushellIntegration = true; enableNushellIntegration = true;

View file

@ -10,7 +10,10 @@
age = { age = {
sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"]; sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
keyFile = if (config.os == "linux") then "/home/xqtc/.config/sops/age/keys.txt" else "/Users/xqtc/.config/sops/age/keys.txt"; keyFile =
if (config.os == "linux")
then "/home/xqtc/.config/sops/age/keys.txt"
else "/Users/xqtc/.config/sops/age/keys.txt";
generateKey = true; generateKey = true;
}; };
}; };

View file

@ -14,19 +14,19 @@
# keyFile = "/var/lib/sops/age/keys.txt"; # keyFile = "/var/lib/sops/age/keys.txt";
# generateKey = true; # generateKey = true;
# }; # };
secrets = { secrets = {
"xqtc_private" = { "xqtc_private" = {
# path = if (pkgs.system == "aarch64-darwin") then "/Users/xqtc/.ssh/id_ed25519" else "/home/xqtc/.ssh/id_ed25519"; # path = if (pkgs.system == "aarch64-darwin") then "/Users/xqtc/.ssh/id_ed25519" else "/home/xqtc/.ssh/id_ed25519";
path = config.home.homeDirectory + "/.ssh/id_ed25519"; path = config.home.homeDirectory + "/.ssh/id_ed25519";
# owner = "xqtc"; # owner = "xqtc";
mode = "600"; mode = "600";
};
"xqtc_public" = {
# path = if (pkgs.system == "aarch64-darwin") then "/Users/xqtc/.ssh/id_ed25519.pub" else "/home/xqtc/.ssh/id_ed25519.pub";
path = config.home.homeDirectory + "/.ssh/id_ed25519.pub";
# owner = "xqtc";
mode = "640";
};
}; };
"xqtc_public" = {
# path = if (pkgs.system == "aarch64-darwin") then "/Users/xqtc/.ssh/id_ed25519.pub" else "/home/xqtc/.ssh/id_ed25519.pub";
path = config.home.homeDirectory + "/.ssh/id_ed25519.pub";
# owner = "xqtc";
mode = "640";
};
};
}; };
} }