refactoring, add packages

This commit is contained in:
Patrick Neff 2024-03-10 13:12:56 +01:00
parent b1b38cef35
commit 55052eb960
16 changed files with 159 additions and 20 deletions

View File

@ -0,0 +1,15 @@
{ vars, inputs, ... }:
let
inherit (vars) username;
in
{
imports = [
../../modules
../../modules/wsl
../../modules/home-manager
];
home-manager.users.${username} = ./home.nix;
system.stateVersion = "23.11";
}

8
hosts/wsl-dev/home.nix Normal file
View File

@ -0,0 +1,8 @@
{ inputs, ... }: {
imports = [
inputs.neovim-flake.homeModules.default
inputs.home-manager-flake.homeModules.base
inputs.home-manager-flake.homeModules.shell
inputs.home-manager-flake.homeModules.dev
];
}

15
modules/base/default.nix Normal file
View File

@ -0,0 +1,15 @@
_: {
imports = [
./user
./network
./i18n
./nixos
./programs
./ssh
./power-management
];
config = {
hardware.enableRedistributableFirmware = true;
};
}

View File

@ -3,5 +3,7 @@ let
inherit (vars) hostName;
in
{
networking.hostName = hostName;
networking = {
inherit hostName;
};
}

View File

@ -0,0 +1,30 @@
{ lib, config, ... }: {
options = {
services.power-management.enable = lib.mkEnableOption "power-management";
};
config = lib.mkIf config.services.power-management.enable {
services = {
power-profiles-daemon.enable = true;
upower.enable = true;
};
users.groups.power = { };
security.polkit = {
extraConfig = ''
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.systemd1.manage-units" ||
action.id == "org.freedesktop.systemd1.manage-unit-files") {
if (action.lookup("unit") == "poweroff.target") {
if (subject.isInGroup("power")) {
return polkit.Result.YES;
} else {
return polkit.Result.AUTH_ADMIN;
}
}
}
});
'';
};
};
}

View File

@ -0,0 +1,26 @@
{ config, lib, pkgs, vars, ... }:
{
environment = {
systemPackages = with pkgs; [
vim
git
openssh
file
w3m
btop
iftop
iotop
ncdu
];
etc = {
"ncdu.conf".text = ''
--color dark
'';
};
};
programs = {
zsh.enable = true;
command-not-found.enable = false;
};
}

View File

@ -0,0 +1,9 @@
{ lib, config, ... }: lib.mkIf config.services.openssh.enable {
services.openssh = {
settings = {
PermitRootLogin = "prohibit-password";
PasswordAuthentication = false;
};
openFirewall = true;
};
}

View File

@ -4,7 +4,7 @@ let
in
{
users = {
defaultUserShell = pkgs.zsh;
# defaultUserShell = pkgs.zsh;
groups.odie = { };
users = {
${username} = {

View File

@ -1,9 +1,5 @@
_: {
imports = [
./user
./network
./i18n
./nixos
./programs
./base
];
}

View File

View File

@ -0,0 +1,33 @@
{ pkgs, ... }: {
fonts = {
enableDefaultPackages = true;
packages = with pkgs; [
roboto
roboto-slab
noto-fonts
noto-fonts-emoji
sarasa-gothic
(nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; })
];
fontconfig = {
antialias = true;
allowType1 = false;
allowBitmaps = false;
hinting = {
enable = true;
style = "slight";
autohint = false;
};
subpixel = {
rgba = "rgb";
lcdfilter = "default";
};
defaultFonts = {
emoji = [ "Noto Color Emoji" ];
serif = [ "Roboto Slab" "Noto Serif" "Sarasa Gothic CL" "Symbols Nerd Font" ];
sansSerif = [ "Roboto" "Noto Sans" "Sarasa Gothic CL" "Symbols Nerd Font" ];
monospace = [ "JetBrains Mono" "Sarasa Mono CL" "Symbols Nerd Font Mono" ];
};
};
};
}

View File

@ -0,0 +1,18 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
alsa-utils
];
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
wireplumber.enable = true;
};
sound.enable = true;
}

View File

@ -1,13 +0,0 @@
{ config, lib, pkgs, vars, ... }:
{
environment.systemPackages = with pkgs; [
vim
git
openssh
];
programs = {
zsh.enable = true;
command-not-found.enable = false;
};
}