more refactoring

This commit is contained in:
sadan 2024-10-02 17:19:34 -04:00
parent 375a1b2e89
commit 5fca9d16c0
No known key found for this signature in database
13 changed files with 163 additions and 78 deletions

View file

@ -2,66 +2,42 @@
# your system. Help is available in the configuration.nix(5) man page, on # your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). # https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ config, lib, pkgs, inputs, ... }: { pkgs, ... }:
{ {
imports = imports =
[ [
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
../../common/systemModules/boot.nix
../../common/systemModules/audio.nix ../../common/systemModules/audio.nix
../../common/systemModules/kde.nix ../../common/systemModules/kde.nix
../../common/systemModules/tailscale.nix
../../common/systemModules/gaming.nix
../../common/systemModules/crypt.nix
../../common/systemModules/printing.nix
# USERS
../../common/users/meyer ../../common/users/meyer
]; ];
# Use the systemd-boot EFI boot loader.
boot.loader.grub.device = "nodev";
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.loader.grub.efiSupport = true;
boot.loader.grub.useOSProber = true;
boot.loader.grub.efiInstallAsRemovable = true;
# boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; # boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
# add user to "openrazer" group
hardware.openrazer.enable = true;
hardware.openrazer.users = [ "meyer" ];
hardware.i2c.enable = true; hardware.i2c.enable = true;
hardware.xpadneo.enable = true;
hardware.amdgpu.opencl.enable = true; hardware.amdgpu.opencl.enable = true;
services.xserver.videoDrivers = [ "amdgpu" ];
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
services.tailscale.enable = true;
networking.hostName = "nix-desktop-evo4b5"; # Define your hostname. networking.hostName = "nix-desktop-evo4b5"; # Define your hostname.
# Pick only one of the below networking options.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Set your time zone. # Set your time zone.
time.timeZone = "America/New_York"; time.timeZone = "America/New_York";
# Select internationalisation properties. nixpkgs.config.allowUnfree = true;
# i18n.defaultLocale = "en_US.UTF-8"; nix.settings.experimental-features = [ "nix-command" "flakes" ];
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# useXkbConfig = true; # use xkb.options in tty.
# };
services = { services = {
teamviewer.enable = true; teamviewer.enable = true;
avahi.enable = true;
usbmuxd.enable = true; usbmuxd.enable = true;
}; };
services.xserver.videoDrivers = [ "amdgpu" ];
services.printing.enable = true;
services.printing.drivers = with pkgs; [
hplip
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
programs.zsh.enable = true; programs.zsh.enable = true;
programs.steam.enable = true;
programs.steam.extraCompatPackages = with pkgs; [
proton-ge-bin
];
nixpkgs.config.allowUnfree = true;
@ -77,10 +53,6 @@
wget wget
ripgrep ripgrep
tldr tldr
gnupg
openssh
pinentry-curses
pinentry
libnotify libnotify
file file
]; ];
@ -116,13 +88,6 @@
mimalloc mimalloc
libstdcxx5 libstdcxx5
]; ];
programs.ssh.startAgent = true;
programs.ssh.askPassword = pkgs.lib.mkForce "${pkgs.ksshaskpass.out}/bin/ksshaskpass";
programs.gnupg.agent = {
enable = true;
pinentryPackage = pkgs.pinentry-gnome3;
};
# This option defines the first version of NixOS you have installed on this particular machine, # This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.

View file

@ -0,0 +1,14 @@
{ pkgs, ... }: {
boot = {
loader = {
grub = {
enable = true;
device = "nodev";
efiSupport = true;
useOSProber = true;
efiInstallAsRemovable = true;
};
};
kernelPackages = pkgs.linuxPackages_latest;
};
}

View file

@ -0,0 +1,22 @@
{ pkgs, ... }: {
environment = {
systemPackages = with pkgs; [
gnupg
openssh
pinentry-curses
pinentry
];
};
programs = {
ssh = {
startAgent = true;
askPassword = "${pkgs.ksshaskpass}/bin/ksshaskpass";
};
gnupg = {
agent = {
enable = true;
pinentryPackage = pkgs.pinentry-gnome3;
};
};
};
}

View file

@ -0,0 +1,15 @@
{ pkgs, ... }: {
hardware = {
xpadneo = {
enable = true;
};
};
programs = {
steam = {
enable = true;
extraCompatPackages = with pkgs; [
proton-ge-bin
];
};
};
}

View file

@ -0,0 +1,12 @@
{ NAME }: { ... }: {
programs = {
nh = {
enable = true;
clean = {
enable = true;
extraArgs = "--keep-since 4d --keep 3";
};
flake = "/home/${NAME}/nixos"
};
};
}

View file

@ -0,0 +1,13 @@
{ pkgs, ... }: {
services = {
avahi = {
enable = true;
};
printing = {
enable = true;
drivers = with pkgs; [
hplip
];
};
};
}

View file

@ -0,0 +1,8 @@
{ NAME }: { ... }: {
hardware = {
openrazer = {
enable = true;
users = [ NAME ];
};
};
}

View file

@ -0,0 +1,7 @@
{ ... }: {
services = {
tailscale = {
enable = true;
};
};
}

View file

@ -0,0 +1,8 @@
{ pkgs, ... }: {
programs = {
java = {
enable = true;
package = pkgs.temurin-bin-17;
};
};
}

View file

@ -7,6 +7,8 @@ in
(import ../../systemModules/networkManager.nix { inherit NAME; }) (import ../../systemModules/networkManager.nix { inherit NAME; })
(import ../../systemModules/sops.nix { inherit NAME; }) (import ../../systemModules/sops.nix { inherit NAME; })
(import ../../systemModules/vm.nix { inherit NAME; }) (import ../../systemModules/vm.nix { inherit NAME; })
(import ../../systemModules/razer.nix { inherit NAME; })
(import ../../systemModules/nixHelper.nix { inherit NAME; })
(import ../../programs/wireshark.nix { inherit NAME; }) (import ../../programs/wireshark.nix { inherit NAME; })
]; ];
users = { users = {

View file

@ -0,0 +1,35 @@
{ ... }: {
programs = {
git = {
enable = true;
userName = "sadan";
userEmail = "117494111+sadan4@users.noreply.github.com";
extraConfig = {
gpg = {
format = "ssh";
};
user = {
signingkey = "~/.ssh/id_ed25519";
};
commit = {
gpgsign = true;
};
core = {
autocrlf = "input";
};
pull = {
rebase = true;
};
push = {
autoSetupRemote = true;
};
init = {
defaultBranch = "main";
};
rerere = {
enabled = true;
};
};
};
};
}

View file

@ -1,39 +1,24 @@
{ config, pkgs, inputs, ... }: { config, pkgs, ... }:
let let
files = import ../../files.nix { inherit config; }; file = import ../../files.nix { inherit config; };
shell = import ../../shell.nix { inherit config pkgs; }; shell = import ../../shell.nix { inherit config pkgs; };
pkgTypes = import ../../pkgs.nix { inherit pkgs config; }; pkgTypes = import ../../pkgs.nix { inherit pkgs config; };
packages = pkgTypes.dev ++ pkgTypes.gui ++ pkgTypes.general ++ pkgTypes.scripts ++ pkgTypes.gaming; packages = pkgTypes.dev ++ pkgTypes.gui ++ pkgTypes.general ++ pkgTypes.scripts ++ pkgTypes.gaming;
in in
{ {
nixpkgs.config.allowInsecurePredicate = (pkg: true); nixpkgs.config.allowInsecurePredicate = (pkg: true);
nixpkgs.config.allowUnfreePredicate = (pkg: true);
imports = [ imports = [
../homeModules/flameshot.nix ../homeModules/flameshot.nix
../homeModules/arrpc.nix ../homeModules/arrpc.nix
../homeModules/zsh.nix ../homeModules/zsh.nix
../homeModules/desktopEntries.nix ../homeModules/desktopEntries.nix
../homeModules/java.nix
./sops.nix ./sops.nix
./git.nix
]; ];
programs.java.enable = true;
programs.java.package = pkgs.temurin-bin-17;
programs.git.enable = true;
programs.git.userName = "sadan";
programs.git.userEmail = "117494111+sadan4@users.noreply.github.com";
programs.git.extraConfig = {
gpg.format = "ssh";
user = {
signingkey = "~/.ssh/id_ed25519";
};
commit.gpgsign = true;
core.autocrlf = "input";
pull.rebase = true;
push.autoSetupRemote = true;
init.defaultBranch = "main";
rerere.enabled = true;
};
nixpkgs.config.allowUnfreePredicate = (pkg: true);
# Home Manager needs a bit of information about you and the paths it should # Home Manager needs a bit of information about you and the paths it should
# nixpkg.config.allowUnfree = true; # nixpkg.config.allowUnfree = true;
# manage. # manage.
@ -41,22 +26,16 @@ in
home.homeDirectory = "/home/meyer"; home.homeDirectory = "/home/meyer";
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
#
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "23.11"; # Please read the comment before changing.
# The home.packages option allows you to install Nix packages into your # The home.packages option allows you to install Nix packages into your
# environment. # environment.
home = { home = {
inherit packages; inherit packages file;
}; };
home.shellAliases = shell.dev.aliases;
home.sessionPath = shell.dev.path;
home.sessionVariables = shell.dev.env;
# Home Manager is pretty good at managing dotfiles. The primary way to manage # Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'. # plain files is through 'home.file'.
home.file = files;
# Home Manager can also manage your environment variables through # Home Manager can also manage your environment variables through
# 'home.sessionVariables'. If you don't want to manage your shell through Home # 'home.sessionVariables'. If you don't want to manage your shell through Home
@ -73,10 +52,15 @@ in
# #
# /etc/profiles/per-user/meyer/etc/profile.d/hm-session-vars.sh # /etc/profiles/per-user/meyer/etc/profile.d/hm-session-vars.sh
# #
home.shellAliases = shell.dev.aliases;
home.sessionPath = shell.dev.path;
home.sessionVariables = shell.dev.env;
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
#
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "23.11"; # Please read the comment before changing.
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.
programs.home-manager.enable = true; programs.home-manager.enable = true;
} }