Initial setup
This commit is contained in:
commit
9b4ec6e0a1
5 changed files with 241 additions and 0 deletions
67
modules/core.nix
Normal file
67
modules/core.nix
Normal file
|
@ -0,0 +1,67 @@
|
|||
{ inputs, pkgs, ... }: {
|
||||
boot.loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
nix = {
|
||||
# hardlink duplicate files in the nix store
|
||||
settings.auto-optimise-store = true;
|
||||
|
||||
extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
|
||||
# keep intermediary deps alive (no redownloading to rebuild after gc)
|
||||
keep-outputs = true
|
||||
keep-derivations = true
|
||||
'';
|
||||
|
||||
# flake registries are used by the new nix commands.
|
||||
# this binds the nixpkgs registry to the one in `flake.nix`.
|
||||
registry = {
|
||||
nixpkgs.flake = inputs.nixpkgs;
|
||||
};
|
||||
|
||||
# the nix path is used to discover channels for the old nix commands.
|
||||
# this binds the nix path to the channels following `flake.nix` declared below.
|
||||
nixPath = [
|
||||
"nixpkgs=/etc/nix/inputs/nixpkgs"
|
||||
];
|
||||
};
|
||||
|
||||
# add entries for `nixPath` above.
|
||||
environment.etc = {
|
||||
"nix/inputs/nixpkgs".source = inputs.nixpkgs.outPath;
|
||||
};
|
||||
|
||||
# allow processes to request scheduling priority
|
||||
security.rtkit.enable = true;
|
||||
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
};
|
||||
|
||||
networking = {
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
dns = "systemd-resolved";
|
||||
};
|
||||
|
||||
nameservers = [ "9.9.9.9" ];
|
||||
};
|
||||
|
||||
services.resolved = {
|
||||
enable = true;
|
||||
dnssec = "true";
|
||||
fallbackDns = [ "9.9.9.9" ];
|
||||
extraConfig = ''
|
||||
DNSOverTLS=yes
|
||||
'';
|
||||
};
|
||||
}
|
68
modules/user/default.nix
Normal file
68
modules/user/default.nix
Normal file
|
@ -0,0 +1,68 @@
|
|||
{ system, inputs, config, pkgs, ... }: let
|
||||
username = "admin";
|
||||
homeDirectory = "/home/${username}";
|
||||
in {
|
||||
imports = [ inputs.home-manager.nixosModules.home-manager ];
|
||||
|
||||
users.users.${username} = {
|
||||
isNormalUser = true;
|
||||
uid = 1000;
|
||||
extraGroups = [ "wheel" ];
|
||||
initialPassword = "test";
|
||||
};
|
||||
|
||||
fonts = {
|
||||
enableDefaultFonts = false;
|
||||
|
||||
fonts = with inputs.stable.legacyPackages.${system}; [
|
||||
dejavu_fonts
|
||||
nerdfonts
|
||||
noto-fonts
|
||||
noto-fonts-cjk
|
||||
];
|
||||
};
|
||||
|
||||
systemd = {
|
||||
# kde polkit agent
|
||||
user.services.polkit-agent = {
|
||||
wants = [ "graphical-session.target" ];
|
||||
after = [ "graphical-session.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 1;
|
||||
TimeoutStopSec = 10;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
pinentryFlavor = "gnome3";
|
||||
};
|
||||
|
||||
environment.variables = {
|
||||
XCURSOR_SIZE = "24";
|
||||
};
|
||||
|
||||
programs.hyprland.enable = true;
|
||||
|
||||
home-manager = {
|
||||
extraSpecialArgs = {
|
||||
inherit system inputs;
|
||||
systemConfig = config;
|
||||
};
|
||||
|
||||
# use system nixpkgs instead of home-manager nixpkgs
|
||||
useGlobalPkgs = true;
|
||||
|
||||
users.${username} = { system, inputs, systemConfig, pkgs, ... }: {
|
||||
home = {
|
||||
inherit username homeDirectory;
|
||||
stateVersion = systemConfig.system.stateVersion;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue