nix-server/default.nix

68 lines
1.7 KiB
Nix
Executable file

{ config, inputs, lib, pkgs, ... }:
let
inherit (builtins) toString;
inherit (lib.modules) mkDefault mkIf;
inherit (lib.my) mapModulesRec';
in {
imports =
[
inputs.home-manager.nixosModules.home-manager
inputs.vscode-server.nixosModules.default
]
++ (mapModulesRec' (toString ./modules) import);
environment.variables = {
NIXPKGS_ALLOW_UNFREE = "1";
};
nix = {
package = pkgs.nix;
# flake registry and nix path pinning
# might not be needed? see: https://github.com/NixOS/nixpkgs/commit/e456032addae76701eb17e6c03fc515fd78ad74f
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
registry.nixpkgs.flake = inputs.nixpkgs;
settings = {
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true;
keep-outputs = true;
keep-derivations = true;
substituters = [
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
optimise.automatic = true;
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
};
system.stateVersion = mkDefault "23.11";
system.configurationRevision = with inputs; mkIf (self ? rev) self.rev;
boot = {
kernelPackages = mkDefault pkgs.linuxPackages_latest;
kernelParams = [ "pci_aspm.policy=performance" ];
};
time.timeZone = mkDefault "America/Los_Angeles";
i18n.defaultLocale = mkDefault "en_US.UTF-8";
hardware.enableRedistributableFirmware = true;
environment.systemPackages = with pkgs; [
unrar unzip
micro
curl wget
git
];
}