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

@ -5,7 +5,7 @@
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,10 +1,15 @@
{ 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

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;

View file

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

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,7 +9,8 @@
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 =
(lib.optionals (config.os == "linux") (with pkgs; [
yubioath-flutter yubioath-flutter
steam steam
heroic heroic
@ -41,7 +42,8 @@ in {
signal-desktop signal-desktop
# ida-free # ida-free
# spotify # spotify
])) ++ (with pkgs; [ ]))
++ (with pkgs; [
nh nh
ncspot ncspot
@ -74,20 +76,15 @@ in {
moodle-dl moodle-dl
obsidian obsidian
prismlauncher prismlauncher
# marked as broken # marked as broken
# syncthingtray # syncthingtray
rbw rbw
nodejs nodejs
# cabal # cabal
@ -97,7 +94,6 @@ in {
# rizin # rizin
# (cutter.withPlugins (ps: with ps; [jsdec rz-ghidra sigdb])) # (cutter.withPlugins (ps: with ps; [jsdec rz-ghidra sigdb]))
nerdfonts nerdfonts
ipafont ipafont

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;
}; };
}; };