nixos-configs/common/default.nix

154 lines
2.9 KiB
Nix
Raw Normal View History

2023-11-22 15:33:16 -05:00
{
config,
2023-12-03 04:50:17 -05:00
home-manager,
lib,
2023-11-22 15:33:16 -05:00
nh,
nix-melt,
nurl,
pkgs,
2024-06-15 22:51:36 -04:00
self,
2023-11-22 15:33:16 -05:00
...
}: {
2023-10-15 14:43:23 -04:00
imports = [
./vars
./modules
./packages.nix
self.nixosModules.borgbackup
2023-12-03 04:50:17 -05:00
home-manager.nixosModules.home-manager
2023-10-15 14:43:23 -04:00
];
2024-04-18 14:37:46 -04:00
boot.tmp.useTmpfs = true;
2024-06-28 13:40:52 -04:00
systemd.services.nix-daemon = {
environment.TMPDIR = "/home/nix-cache";
2024-06-28 13:40:52 -04:00
preStart = ''
mkdir -p ${config.systemd.services.nix-daemon.environment.TMPDIR}
'';
};
nix = {
chore: update flake.lock and update to nix 2.24 Flake Inputs: • Updated input 'discord-overlay': 'github:matt1432/discord-nightly-overlay/80798c7' (2024-08-13) → 'github:matt1432/discord-nightly-overlay/559c675' (2024-08-14) • Updated input 'discord-overlay/Vencord-src': 'github:Vendicated/vencord/5160f90' (2024-08-03) → 'github:Vendicated/vencord/4301ed8' (2024-08-13) • Updated input 'gpu-screen-recorder-src': 'git+https://repo.dec05eba.com/gpu-screen-recorder?ref=refs/heads/master&rev=01b8cdc' (2024-08-10) → 'git+https://repo.dec05eba.com/gpu-screen-recorder?ref=refs/heads/master&rev=f297a92' (2024-08-15) • Updated input 'gtk-theme-src': 'github:dracula/gtk/f339612' (2024-08-06) → 'github:dracula/gtk/be80a12' (2024-08-14) • Updated input 'hyprland': 'git+https://github.com/hyprwm/Hyprland?ref=refs/heads/main&rev=3b4aabe&submodules=1' (2024-08-13) → 'git+https://github.com/hyprwm/Hyprland?ref=refs/heads/main&rev=12d9901&submodules=1' (2024-08-15) • Updated input 'hyprland/systems': 'github:nix-systems/default-linux/31732fc' (2023-07-14) → follows 'systems' • Updated input 'jovian': 'github:Jovian-Experiments/Jovian-NixOS/9117806' (2024-08-11) → 'github:Jovian-Experiments/Jovian-NixOS/e4e0ca1' (2024-08-15) • Updated input 'nh': 'github:viperML/nh/ea90538' (2024-08-07) → 'github:viperML/nh/24d7b24' (2024-08-15) • Updated input 'nix-melt': 'github:nix-community/nix-melt/46d1c35' (2024-02-19) → 'github:bryango/nix-melt/5763489' (2024-08-13) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/a58bc8a' (2024-08-11) → 'github:NixOS/nixpkgs/c3aa7b8' (2024-08-14) Docker Images: • vegardit/gitea-act-runner dind-latest: sha256:0f2cedb38b779319f005dea39b1ac532757aa52bf327d93e2a2d8d82a50b04eb → sha256:1ddf1cb7a19b7dd314e1fd5762e7e69e084d1818778f535969fd1727484ae41c • postgres 14: sha256:09f24db0563ca0463bad203ffd584b6e48f8f87624fe75ab3df0841c8b3ef049 → sha256:e3cc76b6d4dfc8f3547641d67053092e7c108e03ab159c00b48fa8d891e2f7b4 • rssbridge/rss-bridge latest: sha256:d6c6605bbb3c986a505c63625466d7fa00c1a58bf0b1c5d0c923fda0aab340c1 → sha256:3bde3fa44e79c0bd3ed02b45e9e96456ef428cb3421a057f3dfbf310b9b1728d • ghcr.io/immich-app/immich-machine-learning v1.112.1: sha256:d4a5db2c7cda2897abea98a3d5fd0c3cc76618fff271708075faeee426fe1b64 → sha256:9600eff5a66ae426293f00b171711bc1647c85cf966d759ee08ab2d05e0580b5 • ghcr.io/immich-app/immich-server v1.112.1: sha256:14ad5881f5afbea1dbf751e14acaafe00e6b012ffb18a56e9f117b00eb067d1d → sha256:c4e817f0eadbd9a6c2699cc884d5e7070428daec813c17db77d31fcca5b78ca6 • nginx latest: sha256:93db6ea665b5485e59f0b35e506456b5055925d43011bdcc459d556332d231a2 → sha256:447a8665cc1dab95b1ca778e162215839ccbb9189104c79d7ec3a81e14577add • onlyoffice/documentserver latest: sha256:9b74cb0e05580bced87f9af69de68d5f4c9e5b3340448ddc94333f5f7f4eba85 → sha256:d9437b6d8455de45a02dd5ed2529c8c19c5d1407076c03ca73e0737941ec3748 • ghcr.io/linuxserver/sabnzbd latest: sha256:aad79c7a696a8743b87f9a0429bf5fa0be1edc8bbf00b962008dfa9893efd28e → sha256:95179d6de1c660d7dcd4bd3991b33871c88df1120ab84bc553c4a67e8cc412d2
2024-08-15 22:22:59 -04:00
package = pkgs.nixVersions.nix_2_24;
2024-07-24 21:58:37 -04:00
# Edit nix.conf
settings = {
# Store
keep-outputs = true;
keep-derivations = true;
auto-optimise-store = true;
# Commands
experimental-features = ["nix-command" "flakes"];
http-connections = 0; # unlimited for local cache
warn-dirty = false;
show-trace = true;
2024-06-10 22:57:20 -04:00
allow-import-from-derivation = true;
2023-12-20 03:47:22 -05:00
# remote building
trusted-users = ["matt" "nixremote"];
};
};
2024-04-18 14:37:46 -04:00
programs.nh = {
enable = true;
2024-04-18 14:37:46 -04:00
package = nh.packages.${pkgs.system}.default;
# weekly cleanup
clean = {
enable = true;
extraArgs = "--keep-since 30d";
};
2023-11-19 15:32:28 -05:00
};
2023-11-30 17:01:46 -05:00
services = {
fwupd.enable = true;
xserver.xkb = {
2023-11-30 17:01:46 -05:00
layout = "ca";
variant = "multix";
2023-11-30 17:01:46 -05:00
};
};
boot.supportedFilesystems = ["ext4" "xfs" "btrfs" "vfat" "ntfs"];
system.fsPackages = with pkgs; [
btrfs-progs
nfs-utils
ntfs3g
xfsprogs
];
2024-07-31 15:50:51 -04:00
environment.variables.NPM_CONFIG_GLOBALCONFIG = "/etc/npmrc";
environment.etc.npmrc.text = ''
fund = false
update-notifier = false
'';
environment.systemPackages =
(with pkgs; [
# Peripherals
hdparm
pciutils
usbutils
])
++ [
nix-melt.packages.${pkgs.system}.default
(nurl.packages.${pkgs.system}.default.override {
nix = config.nix.package;
})
];
home-manager = let
2024-06-15 22:51:36 -04:00
inherit (lib) mapAttrs' nameValuePair;
inherit (config.vars) mainUser;
2024-01-04 03:39:14 -05:00
mainUserConf = config.home-manager.users.${mainUser};
2023-10-15 14:30:30 -04:00
default = {
imports = [
2023-12-08 12:48:48 -05:00
# Make the vars be the same on Nix and HM
{
options.vars = lib.mkOption {
type = lib.types.attrs;
readOnly = true;
default = config.vars;
};
}
2023-12-08 12:48:48 -05:00
{
programs.bash.sessionVariables = {
FLAKE = config.environment.variables.FLAKE;
};
}
./home
2023-12-23 22:57:43 -05:00
./home/trash-d
2023-10-15 14:30:30 -04:00
];
2024-06-15 22:51:36 -04:00
# Cache devShells
2024-06-16 11:31:26 -04:00
home.file = mapAttrs' (n: v:
nameValuePair ".cache/devShells/${n}" {
source = v;
})
self.devShells.${pkgs.system};
2023-10-15 14:30:30 -04:00
};
in {
users = {
root =
default
// {
home.stateVersion = mainUserConf.home.stateVersion;
};
greeter =
lib.mkIf (config.services.greetd.enable)
(default
// {
home.stateVersion = mainUserConf.home.stateVersion;
});
${mainUser} = default;
};
2023-10-15 14:30:30 -04:00
};
2023-10-15 14:43:23 -04:00
}