Merge branch 'main' of github.com:asosnovsky/nixos-setup

This commit is contained in:
ari committed 2024-05-29 15:19:19 -04:00
commit 51f15e0652
41 files changed
+425 -130

No files matched your search

File renamed without changes.
@@ -40,6 +40,7 @@ in
neofetch
ipfetch
nixd
devbox
];
};
programs = {
@@ -69,7 +70,11 @@ in
init = { defaultBranch = "main"; };
};
includes =
(builtins.map (f: { path = gitconfigs + "/" + f; }) gitconfigFiles);
(builtins.map (f: { path = gitconfigs + "/" + f; }) gitconfigFiles)
++ (if builtins.hasAttr "extraGitConfigs" user then
user.extraGitConfigs
else
[ ]);
};
zsh = {
enable = true;
@@ -88,12 +93,7 @@ in
enable = true;
clock24 = true;
mouse = true;
plugins = with pkgs.tmuxPlugins; [
nord
cpu
battery
sidebar
];
plugins = with pkgs.tmuxPlugins; [ nord cpu battery sidebar ];
};
};
};
File renamed without changes.
File renamed without changes.
+1 -1
View File
@@ -38,7 +38,7 @@ in
attrs = attrs;
home-manager-modules = [
home-manager.darwinModules.home-manager
(import ./macos-home-manager.nix { user = user; })
(import ./home-manager/macos.nix { user = user; })
];
}) ++ [
(import ./macos.nix {
+1
View File
@@ -3,5 +3,6 @@
services.nix-daemon.enable = true;
security.pam.enableSudoTouchIdAuth = true;
users.users.${user.name}.home = user.homepath;
users.users.root.home = "/var/root";
nixpkgs.hostPlatform = system;
}
+5 -5
View File
@@ -19,12 +19,12 @@
{ ... }:
{
imports = [
(import ./nix/main.nix {
(import ./nix {
user = user;
systemStateVersion = "23.11";
systemStateVersion = systemStateVersion;
})
] ++ (if desktop.enable then [
(import ./desktop/main.nix {
(import ./desktop {
user = user;
enableKDE = desktop.enableKDE;
enableHypr = desktop.enableHypr;
@@ -32,7 +32,7 @@
enableWine = desktop.enableWine;
})
] else [ ]) ++ (if os.enable then [
(import ./os/main.nix {
(import ./os {
user = user;
hostName = hostName;
firewall = os.firewall;
@@ -42,7 +42,7 @@
hardware = os.hardware;
})
] else [ ]) ++ (if home-manager.enable then [
(import ./home-manager-config.nix {
(import ./home-manager/common.nix {
user = user;
homeMangerVersion = home-manager.version;
hostName = hostName;
@@ -4,9 +4,13 @@
# Nix core
system.stateVersion = systemStateVersion;
nixpkgs.config.allowUnfree = true;
services.hydra.useSubstitutes = true;
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
substituters = [
"https://cache.nixos.org"
"https://cache.flox.dev"
"https://devenv.cachix.org"
];
trusted-substituters = [
"https://cache.flox.dev"
"https://devenv.cachix.org"
@@ -17,37 +21,22 @@
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
];
};
# Set your time zone.
time.timeZone = "America/Toronto";
# Select internationalisation properties.
i18n.defaultLocale = "en_CA.UTF-8";
# System Packages
programs.zsh.enable = true;
programs.nix-ld.enable = true;
environment.systemPackages = with pkgs; [
# nix utils
nix-index
nil
cachix
nixpkgs-fmt
nix-serve
# shell tools
wget
# misc
glib
glibc
];
# Storage Optim
nix.optimise.automatic = true;
nix.optimise.dates = [ "01:00" ];
services.cron = {
enable = true;
systemCronJobs = [
"* 23 * * * root nix-collect-garbage --delete-older-than 1d"
"* 23 * * * ${user.name} nix-collect-garbage --delete-older-than 1d"
];
};
}
-12
View File
@@ -1,12 +0,0 @@
{ user
, systemStateVersion
}:
{ ... }:
{
imports = [
(import ./core.nix {
user = user;
systemStateVersion = systemStateVersion;
})
];
}
+23
View File
@@ -1,8 +1,15 @@
{ user }:
{ pkgs, ... }:
{
# System Packages
services.hydra.useSubstitutes = true;
services.flatpak.enable = true;
services.nix-serve = {
enable = true;
port = 5000;
};
programs.dconf.enable = true;
programs.nix-ld.enable = true;
environment.systemPackages = with pkgs; [
# nix utils
appimage-run
@@ -17,6 +24,8 @@
# misc
glib-networking
glib
glibc
# printer
system-config-printer
@@ -24,4 +33,18 @@
services.xserver.excludePackages = with pkgs; [
xterm
];
# Set your time zone.
time.timeZone = "America/Toronto";
# Select internationalisation properties.
i18n.defaultLocale = "en_CA.UTF-8";
# Storage Clean up
services.cron = {
enable = true;
systemCronJobs = [
"* 23 * * * root nix-collect-garbage --delete-older-than 1d"
"* 23 * * * ${user.name} nix-collect-garbage --delete-older-than 1d"
];
};
}
@@ -11,7 +11,9 @@
{ pkgs, ... }:
{
imports = [
./core.nix
(import ./core.nix {
user = user;
})
./rootUser.nix
(import ./user.nix {
user = user;
+18 -15
View File
@@ -1,18 +1,21 @@
{ enableSSHServer, user }:
{ ... }:
{
services.openssh = if enableSSHServer then {
enable = true;
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
settings.PermitRootLogin = "yes";
} else {
enable = false;
};
users.users.${user.name}.openssh.authorizedKeys.keys = if enableSSHServer then [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuatskL9qXvgvS3E8zRwosFnpcN0f8PkKl8syAvpn297V2iPk6mi8yK3EE7xPpxaKKlwUuBHDj3BNUCoLgdRFKUgroRDzr3BMm+gZTHy6CuEZBY9zBRTmH+aOV6FZ96QPW4zba0BW5YPkPNy/FhYibjpXyZ3nX4/LWSbPKQJ7wTnUJZgq4VFmevBOttvhzUJUgTziMFsGXn6I38fAi6LI8qwI+zOOdsNjtKgr/TIlO/7VqcH7GYnQEwlthl577sDd1V6+XWz649qoiBYyq0Ahm09dwYx2iGQwLo8IYFbSy4aJRK/PI0+ytnPBoF5QCl+ILb5E8uV3e6Wb9WpXl9Hv2iLx91/9iq5hykHPnfVtkq3MK0C2vqkvX1qFOIkKM7vmxvXGbaDZDGK3G+/zkQ7GUw8ydbl9wGwE9cKbm9miqs4w2Ry/+3IZasE6G2TI97bSzSYInQd2RwoglqBOaJojbUqgI9wvNdKxGhADNFbZah2+s6SSe1ByQRN3b9wtmqu0= ari@shared"
] else [];
users.users.root.openssh.authorizedKeys.keys = if enableSSHServer then [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuatskL9qXvgvS3E8zRwosFnpcN0f8PkKl8syAvpn297V2iPk6mi8yK3EE7xPpxaKKlwUuBHDj3BNUCoLgdRFKUgroRDzr3BMm+gZTHy6CuEZBY9zBRTmH+aOV6FZ96QPW4zba0BW5YPkPNy/FhYibjpXyZ3nX4/LWSbPKQJ7wTnUJZgq4VFmevBOttvhzUJUgTziMFsGXn6I38fAi6LI8qwI+zOOdsNjtKgr/TIlO/7VqcH7GYnQEwlthl577sDd1V6+XWz649qoiBYyq0Ahm09dwYx2iGQwLo8IYFbSy4aJRK/PI0+ytnPBoF5QCl+ILb5E8uV3e6Wb9WpXl9Hv2iLx91/9iq5hykHPnfVtkq3MK0C2vqkvX1qFOIkKM7vmxvXGbaDZDGK3G+/zkQ7GUw8ydbl9wGwE9cKbm9miqs4w2Ry/+3IZasE6G2TI97bSzSYInQd2RwoglqBOaJojbUqgI9wvNdKxGhADNFbZah2+s6SSe1ByQRN3b9wtmqu0= ari@shared"
] else [];
}
services.openssh =
if enableSSHServer then {
enable = true;
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
settings.PermitRootLogin = "yes";
} else {
enable = false;
};
users.users.${user.name}.openssh.authorizedKeys.keys =
if enableSSHServer then [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuatskL9qXvgvS3E8zRwosFnpcN0f8PkKl8syAvpn297V2iPk6mi8yK3EE7xPpxaKKlwUuBHDj3BNUCoLgdRFKUgroRDzr3BMm+gZTHy6CuEZBY9zBRTmH+aOV6FZ96QPW4zba0BW5YPkPNy/FhYibjpXyZ3nX4/LWSbPKQJ7wTnUJZgq4VFmevBOttvhzUJUgTziMFsGXn6I38fAi6LI8qwI+zOOdsNjtKgr/TIlO/7VqcH7GYnQEwlthl577sDd1V6+XWz649qoiBYyq0Ahm09dwYx2iGQwLo8IYFbSy4aJRK/PI0+ytnPBoF5QCl+ILb5E8uV3e6Wb9WpXl9Hv2iLx91/9iq5hykHPnfVtkq3MK0C2vqkvX1qFOIkKM7vmxvXGbaDZDGK3G+/zkQ7GUw8ydbl9wGwE9cKbm9miqs4w2Ry/+3IZasE6G2TI97bSzSYInQd2RwoglqBOaJojbUqgI9wvNdKxGhADNFbZah2+s6SSe1ByQRN3b9wtmqu0= ari@shared"
] else [ ];
users.users.root.openssh.authorizedKeys.keys =
if enableSSHServer then [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuatskL9qXvgvS3E8zRwosFnpcN0f8PkKl8syAvpn297V2iPk6mi8yK3EE7xPpxaKKlwUuBHDj3BNUCoLgdRFKUgroRDzr3BMm+gZTHy6CuEZBY9zBRTmH+aOV6FZ96QPW4zba0BW5YPkPNy/FhYibjpXyZ3nX4/LWSbPKQJ7wTnUJZgq4VFmevBOttvhzUJUgTziMFsGXn6I38fAi6LI8qwI+zOOdsNjtKgr/TIlO/7VqcH7GYnQEwlthl577sDd1V6+XWz649qoiBYyq0Ahm09dwYx2iGQwLo8IYFbSy4aJRK/PI0+ytnPBoF5QCl+ILb5E8uV3e6Wb9WpXl9Hv2iLx91/9iq5hykHPnfVtkq3MK0C2vqkvX1qFOIkKM7vmxvXGbaDZDGK3G+/zkQ7GUw8ydbl9wGwE9cKbm9miqs4w2Ry/+3IZasE6G2TI97bSzSYInQd2RwoglqBOaJojbUqgI9wvNdKxGhADNFbZah2+s6SSe1ByQRN3b9wtmqu0= ari@shared"
] else [ ];
}