mirror of
https://github.com/sadan4/dotfiles.git
synced 2024-11-16 23:04:39 -05:00
more refactoring
This commit is contained in:
parent
375a1b2e89
commit
5fca9d16c0
13 changed files with 163 additions and 78 deletions
|
@ -2,66 +2,42 @@
|
|||
# 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`).
|
||||
|
||||
{ config, lib, pkgs, inputs, ... }:
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports =
|
||||
[
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
../../common/systemModules/boot.nix
|
||||
../../common/systemModules/audio.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
|
||||
];
|
||||
# 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" ];
|
||||
# add user to "openrazer" group
|
||||
hardware.openrazer.enable = true;
|
||||
hardware.openrazer.users = [ "meyer" ];
|
||||
hardware.i2c.enable = true;
|
||||
hardware.xpadneo.enable = true;
|
||||
hardware.amdgpu.opencl.enable = true;
|
||||
services.xserver.videoDrivers = [ "amdgpu" ];
|
||||
hardware.bluetooth.enable = true;
|
||||
services.tailscale.enable = true;
|
||||
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.
|
||||
time.timeZone = "America/New_York";
|
||||
|
||||
# Select internationalisation properties.
|
||||
# i18n.defaultLocale = "en_US.UTF-8";
|
||||
# console = {
|
||||
# font = "Lat2-Terminus16";
|
||||
# keyMap = "us";
|
||||
# useXkbConfig = true; # use xkb.options in tty.
|
||||
|
||||
# };
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
services = {
|
||||
teamviewer.enable = true;
|
||||
avahi.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.steam.enable = true;
|
||||
programs.steam.extraCompatPackages = with pkgs; [
|
||||
proton-ge-bin
|
||||
];
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
|
||||
|
||||
|
@ -77,10 +53,6 @@
|
|||
wget
|
||||
ripgrep
|
||||
tldr
|
||||
gnupg
|
||||
openssh
|
||||
pinentry-curses
|
||||
pinentry
|
||||
libnotify
|
||||
file
|
||||
];
|
||||
|
@ -116,13 +88,6 @@
|
|||
mimalloc
|
||||
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,
|
||||
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
||||
|
|
14
common/systemModules/boot.nix
Normal file
14
common/systemModules/boot.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ pkgs, ... }: {
|
||||
boot = {
|
||||
loader = {
|
||||
grub = {
|
||||
enable = true;
|
||||
device = "nodev";
|
||||
efiSupport = true;
|
||||
useOSProber = true;
|
||||
efiInstallAsRemovable = true;
|
||||
};
|
||||
};
|
||||
kernelPackages = pkgs.linuxPackages_latest;
|
||||
};
|
||||
}
|
22
common/systemModules/crypt.nix
Normal file
22
common/systemModules/crypt.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
15
common/systemModules/gaming.nix
Normal file
15
common/systemModules/gaming.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ pkgs, ... }: {
|
||||
hardware = {
|
||||
xpadneo = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
programs = {
|
||||
steam = {
|
||||
enable = true;
|
||||
extraCompatPackages = with pkgs; [
|
||||
proton-ge-bin
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
12
common/systemModules/nixHelper.nix
Normal file
12
common/systemModules/nixHelper.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{ NAME }: { ... }: {
|
||||
programs = {
|
||||
nh = {
|
||||
enable = true;
|
||||
clean = {
|
||||
enable = true;
|
||||
extraArgs = "--keep-since 4d --keep 3";
|
||||
};
|
||||
flake = "/home/${NAME}/nixos"
|
||||
};
|
||||
};
|
||||
}
|
13
common/systemModules/printing.nix
Normal file
13
common/systemModules/printing.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ pkgs, ... }: {
|
||||
services = {
|
||||
avahi = {
|
||||
enable = true;
|
||||
};
|
||||
printing = {
|
||||
enable = true;
|
||||
drivers = with pkgs; [
|
||||
hplip
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
8
common/systemModules/razer.nix
Normal file
8
common/systemModules/razer.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ NAME }: { ... }: {
|
||||
hardware = {
|
||||
openrazer = {
|
||||
enable = true;
|
||||
users = [ NAME ];
|
||||
};
|
||||
};
|
||||
}
|
7
common/systemModules/tailscale.nix
Normal file
7
common/systemModules/tailscale.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ ... }: {
|
||||
services = {
|
||||
tailscale = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
8
common/users/homeModules/java.nix
Normal file
8
common/users/homeModules/java.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ pkgs, ... }: {
|
||||
programs = {
|
||||
java = {
|
||||
enable = true;
|
||||
package = pkgs.temurin-bin-17;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -7,6 +7,8 @@ in
|
|||
(import ../../systemModules/networkManager.nix { inherit NAME; })
|
||||
(import ../../systemModules/sops.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; })
|
||||
];
|
||||
users = {
|
||||
|
|
35
common/users/meyer/git.nix
Normal file
35
common/users/meyer/git.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,39 +1,24 @@
|
|||
{ config, pkgs, inputs, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
files = import ../../files.nix { inherit config; };
|
||||
file = import ../../files.nix { inherit config; };
|
||||
shell = import ../../shell.nix { inherit config pkgs; };
|
||||
pkgTypes = import ../../pkgs.nix { inherit pkgs config; };
|
||||
packages = pkgTypes.dev ++ pkgTypes.gui ++ pkgTypes.general ++ pkgTypes.scripts ++ pkgTypes.gaming;
|
||||
in
|
||||
{
|
||||
nixpkgs.config.allowInsecurePredicate = (pkg: true);
|
||||
nixpkgs.config.allowUnfreePredicate = (pkg: true);
|
||||
imports = [
|
||||
../homeModules/flameshot.nix
|
||||
../homeModules/arrpc.nix
|
||||
../homeModules/zsh.nix
|
||||
../homeModules/desktopEntries.nix
|
||||
../homeModules/java.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
|
||||
# nixpkg.config.allowUnfree = true;
|
||||
# manage.
|
||||
|
@ -41,22 +26,16 @@ in
|
|||
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
|
||||
# environment.
|
||||
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
|
||||
# plain files is through 'home.file'.
|
||||
home.file = files;
|
||||
|
||||
# Home Manager can also manage your environment variables through
|
||||
# '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
|
||||
#
|
||||
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.
|
||||
programs.home-manager.enable = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue