mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
a bunch of code cleanup
This commit is contained in:
parent
977d1ad6d2
commit
016a347d5e
19 changed files with 92 additions and 100 deletions
|
|
@ -63,7 +63,7 @@
|
||||||
specialArgs = {inherit self;};
|
specialArgs = {inherit self;};
|
||||||
modules =
|
modules =
|
||||||
importAll ./modules
|
importAll ./modules
|
||||||
++ importAll "${self}/systems/${name}";
|
++ importAll (self + "/systems/" + name);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ _: {
|
||||||
environment = {
|
environment = {
|
||||||
noXlibs = lib.mkOverride 500 false;
|
noXlibs = lib.mkOverride 500 false;
|
||||||
defaultPackages = [];
|
defaultPackages = [];
|
||||||
systemPackages = with pkgs; [gitMinimal neovim];
|
systemPackages = [pkgs.gitMinimal pkgs.neovim];
|
||||||
variables = {
|
variables = {
|
||||||
EDITOR = "nvim";
|
EDITOR = "nvim";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -5,16 +5,15 @@
|
||||||
lib,
|
lib,
|
||||||
self,
|
self,
|
||||||
...
|
...
|
||||||
}:
|
}: let
|
||||||
with lib; let
|
|
||||||
cfg = config.localModules.DE.dwm;
|
cfg = config.localModules.DE.dwm;
|
||||||
sp = suckless.packages.${pkgs.system};
|
sp = suckless.packages.${pkgs.system};
|
||||||
in {
|
in {
|
||||||
options.localModules.DE.dwm = {
|
options.localModules.DE.dwm = {
|
||||||
enable = mkEnableOption "";
|
enable = lib.mkEnableOption "";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.gvfs.enable = true;
|
services.gvfs.enable = true;
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -27,7 +26,7 @@ in {
|
||||||
defaultSession = "none+dwm";
|
defaultSession = "none+dwm";
|
||||||
};
|
};
|
||||||
windowManager.session =
|
windowManager.session =
|
||||||
singleton
|
lib.singleton
|
||||||
{
|
{
|
||||||
name = "dwm";
|
name = "dwm";
|
||||||
start = ''
|
start = ''
|
||||||
|
|
|
||||||
|
|
@ -4,43 +4,40 @@ _: {
|
||||||
options,
|
options,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}: let
|
||||||
with lib; let
|
|
||||||
cfg = config.localModules.DE.gnome;
|
cfg = config.localModules.DE.gnome;
|
||||||
in {
|
in {
|
||||||
options.localModules.DE.gnome = {
|
options.localModules.DE.gnome = {
|
||||||
enable = mkEnableOption "";
|
enable = lib.mkEnableOption "";
|
||||||
};
|
};
|
||||||
config = mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
environment.gnome.excludePackages =
|
environment.gnome.excludePackages = [
|
||||||
(with pkgs; [
|
pkgs.gnome-photos
|
||||||
gnome-photos
|
pkgs.gnome-tour
|
||||||
gnome-tour
|
pkgs.gnome-text-editor
|
||||||
gnome-text-editor
|
pkgs.gnome-online-accounts
|
||||||
gnome-online-accounts
|
|
||||||
])
|
pkgs.gnome.gnome-weather
|
||||||
++ (with pkgs.gnome; [
|
pkgs.gnome.gnome-shell
|
||||||
gnome-weather
|
pkgs.gnome.gnome-disk-utility
|
||||||
gnome-shell
|
pkgs.gnome.gnome-maps
|
||||||
gnome-disk-utility
|
pkgs.gnome.gnome-clocks
|
||||||
gnome-maps
|
pkgs.gnome.gnome-remote-desktop
|
||||||
gnome-clocks
|
pkgs.gnome.gnome-calendar
|
||||||
gnome-remote-desktop
|
pkgs.gnome.gnome-music
|
||||||
gnome-calendar
|
pkgs.gnome.simple-scan
|
||||||
gnome-music
|
pkgs.gnome.cheese # webcam tool
|
||||||
simple-scan
|
pkgs.gnome.gedit # text editor
|
||||||
cheese # webcam tool
|
pkgs.gnome.epiphany # web browser
|
||||||
gedit # text editor
|
pkgs.gnome.geary # email reader
|
||||||
epiphany # web browser
|
pkgs.gnome.evince # document viewer
|
||||||
geary # email reader
|
pkgs.gnome.gnome-characters
|
||||||
evince # document viewer
|
pkgs.gnome.totem # video player
|
||||||
gnome-characters
|
pkgs.gnome.tali # poker game
|
||||||
totem # video player
|
pkgs.gnome.iagno # go game
|
||||||
tali # poker game
|
pkgs.gnome.hitori # sudoku game
|
||||||
iagno # go game
|
pkgs.gnome.atomix # puzzle game
|
||||||
hitori # sudoku game
|
];
|
||||||
atomix # puzzle game
|
|
||||||
]);
|
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
desktopManager.gnome.enable = true;
|
desktopManager.gnome.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,13 @@ _: {
|
||||||
lib,
|
lib,
|
||||||
options,
|
options,
|
||||||
...
|
...
|
||||||
}:
|
}: let
|
||||||
with lib; let
|
|
||||||
cfg = config.localModules.DE.xfce;
|
cfg = config.localModules.DE.xfce;
|
||||||
in {
|
in {
|
||||||
options.localModules.DE.xfce = {
|
options.localModules.DE.xfce = {
|
||||||
enable = mkEnableOption "";
|
enable = lib.mkEnableOption "";
|
||||||
};
|
};
|
||||||
config = mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
desktopManager.xfce = {
|
desktopManager.xfce = {
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,11 @@ _: {
|
||||||
lib,
|
lib,
|
||||||
options,
|
options,
|
||||||
...
|
...
|
||||||
}:
|
}: let
|
||||||
with lib; let
|
|
||||||
cfg = config.localModules.DM.autoLogin;
|
cfg = config.localModules.DM.autoLogin;
|
||||||
in {
|
in {
|
||||||
options.localModules.DM.autoLogin = mkEnableOption "";
|
options.localModules.DM.autoLogin = lib.mkEnableOption "";
|
||||||
config = mkIf cfg {
|
config = lib.mkIf cfg {
|
||||||
services.xserver.displayManager = {
|
services.xserver.displayManager = {
|
||||||
autoLogin = {
|
autoLogin = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,13 @@ _: {
|
||||||
options,
|
options,
|
||||||
self,
|
self,
|
||||||
...
|
...
|
||||||
}:
|
}: let
|
||||||
with lib; let
|
|
||||||
cfg = config.localModules.DM.lightdm;
|
cfg = config.localModules.DM.lightdm;
|
||||||
in {
|
in {
|
||||||
options.localModules.DM.lightdm = {
|
options.localModules.DM.lightdm = {
|
||||||
enable = mkEnableOption "";
|
enable = lib.mkEnableOption "";
|
||||||
};
|
};
|
||||||
config = mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
displayManager = {
|
displayManager = {
|
||||||
lightdm = {
|
lightdm = {
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,9 @@ _: {
|
||||||
options,
|
options,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}: {
|
||||||
with lib; {
|
options.localModules.DM.loginUser = lib.mkOption {
|
||||||
options.localModules.DM.loginUser = mkOption {
|
type = lib.types.nullOr lib.types.str;
|
||||||
type = types.nullOr types.str;
|
|
||||||
default = null;
|
default = null;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,13 @@ _: {
|
||||||
options,
|
options,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}: let
|
||||||
with lib; let
|
|
||||||
cfg = config.localModules.X11Programs;
|
cfg = config.localModules.X11Programs;
|
||||||
in {
|
in {
|
||||||
options.localModules.X11Programs = {
|
options.localModules.X11Programs = {
|
||||||
sxhkd.enable = mkEnableOption "";
|
sxhkd.enable = lib.mkEnableOption "";
|
||||||
};
|
};
|
||||||
config = mkMerge [
|
config = lib.mkMerge [
|
||||||
{
|
{
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
tty = lib.mkDefault 1;
|
tty = lib.mkDefault 1;
|
||||||
|
|
@ -56,7 +55,7 @@ in {
|
||||||
maim -s | xclip -selection clipboard -t image/png
|
maim -s | xclip -selection clipboard -t image/png
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
mkIf cfg.sxhkd.enable
|
lib.mkIf cfg.sxhkd.enable
|
||||||
{
|
{
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
pkgs.maim #screenshooter
|
pkgs.maim #screenshooter
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ _: {
|
||||||
plymouth = {
|
plymouth = {
|
||||||
enable = lib.mkDefault true;
|
enable = lib.mkDefault true;
|
||||||
theme = "breeze";
|
theme = "breeze";
|
||||||
logo = "${self}/misc/nixos.png";
|
logo = self + /misc/nixos.png;
|
||||||
};
|
};
|
||||||
loader = {
|
loader = {
|
||||||
systemd-boot = {
|
systemd-boot = {
|
||||||
|
|
|
||||||
|
|
@ -4,17 +4,16 @@ _: {
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}: let
|
||||||
with lib; let
|
|
||||||
cfg = config.localModules.git;
|
cfg = config.localModules.git;
|
||||||
in {
|
in {
|
||||||
options.localModules.git = {
|
options.localModules.git = {
|
||||||
disable = mkOption {
|
disable = lib.mkOption {
|
||||||
type = types.bool;
|
type = lib.types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
config = mkIf (! cfg.disable) {
|
config = lib.mkIf (! cfg.disable) {
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.gitMinimal;
|
package = pkgs.gitMinimal;
|
||||||
|
|
|
||||||
|
|
@ -3,27 +3,26 @@ _: {
|
||||||
options,
|
options,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}: let
|
||||||
with lib; let
|
|
||||||
cfg = config.localModules.hardware;
|
cfg = config.localModules.hardware;
|
||||||
in {
|
in {
|
||||||
options.localModules.hardware = {
|
options.localModules.hardware = {
|
||||||
gpuAcceleration = {
|
gpuAcceleration = {
|
||||||
disable = mkOption {
|
disable = lib.mkOption {
|
||||||
type = types.bool;
|
type = lib.types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
sound = {
|
sound = {
|
||||||
disable = mkOption {
|
disable = lib.mkOption {
|
||||||
type = types.bool;
|
type = lib.types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
config = mkMerge [
|
config = lib.mkMerge [
|
||||||
(
|
(
|
||||||
mkIf (! cfg.gpuAcceleration.disable) {
|
lib.mkIf (! cfg.gpuAcceleration.disable) {
|
||||||
hardware.opengl = {
|
hardware.opengl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
driSupport = true;
|
driSupport = true;
|
||||||
|
|
@ -31,7 +30,7 @@ in {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
(mkIf (! cfg.sound.disable) {
|
(lib.mkIf (! cfg.sound.disable) {
|
||||||
security.rtkit.enable = true;
|
security.rtkit.enable = true;
|
||||||
sound.enable = lib.mkForce false; #disable alsa
|
sound.enable = lib.mkForce false; #disable alsa
|
||||||
hardware.pulseaudio.enable = lib.mkForce false; #disable pulseAudio
|
hardware.pulseaudio.enable = lib.mkForce false; #disable pulseAudio
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ in {
|
||||||
#add all inputs to etc
|
#add all inputs to etc
|
||||||
environment.etc = lib.mapAttrs' (name: value: lib.nameValuePair "/nixpath/${name}" {source = value;}) combined_flakes;
|
environment.etc = lib.mapAttrs' (name: value: lib.nameValuePair "/nixpath/${name}" {source = value;}) combined_flakes;
|
||||||
#source the etc paths to nixPath
|
#source the etc paths to nixPath
|
||||||
nix.nixPath = lib.mapAttrsToList (name: _: name + "=" + "/etc/nixpath/${name}") combined_flakes;
|
nix.nixPath = lib.mapAttrsToList (name: _: name + "=/etc/nixpath/${name}") combined_flakes;
|
||||||
|
|
||||||
#other nix settings
|
#other nix settings
|
||||||
nix = {
|
nix = {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
{fetch-rs, ...}: {pkgs, ...}: rec {
|
{fetch-rs, ...}: {
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
#put:
|
#put:
|
||||||
#source /run/current-system/sw/share/nix-direnv/direnvrc
|
#source /run/current-system/sw/share/nix-direnv/direnvrc
|
||||||
#in ~/.direnvrc
|
#in ~/.direnvrc
|
||||||
|
|
@ -55,7 +59,7 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
execWheelOnly = true;
|
execWheelOnly = true;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
Defaults env_keep += "${builtins.concatStringsSep " " (builtins.attrNames environment.variables)}"
|
Defaults env_keep += "${builtins.concatStringsSep " " (builtins.attrNames config.environment.variables)}"
|
||||||
Defaults lecture = never
|
Defaults lecture = never
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
pkgs.sops
|
pkgs.sops
|
||||||
];
|
];
|
||||||
sops = {
|
sops = {
|
||||||
defaultSopsFile = "${self}/systems/${config.networking.hostName}/secrets.yaml";
|
defaultSopsFile = self + "/systems/" + config.networking.hostName + "/secrets.yaml";
|
||||||
age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
|
age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,17 +4,16 @@ _: {
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}: let
|
||||||
with lib; let
|
|
||||||
cfg = config.localModules.theming;
|
cfg = config.localModules.theming;
|
||||||
in {
|
in {
|
||||||
options.localModules.theming = {
|
options.localModules.theming = {
|
||||||
enable = mkEnableOption "";
|
enable = lib.mkEnableOption "";
|
||||||
kmscon.enable = mkEnableOption "";
|
kmscon.enable = lib.mkEnableOption "";
|
||||||
};
|
};
|
||||||
config = mkMerge [
|
config = lib.mkMerge [
|
||||||
(
|
(
|
||||||
mkIf cfg.enable {
|
lib.mkIf cfg.enable {
|
||||||
environment = {
|
environment = {
|
||||||
systemPackages = [
|
systemPackages = [
|
||||||
pkgs.flat-remix-gtk
|
pkgs.flat-remix-gtk
|
||||||
|
|
@ -81,7 +80,7 @@ in {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
(mkIf cfg.kmscon.enable {
|
(lib.mkIf cfg.kmscon.enable {
|
||||||
services.kmscon = {
|
services.kmscon = {
|
||||||
enable = true;
|
enable = true;
|
||||||
hwRender = false;
|
hwRender = false;
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,11 @@
|
||||||
exec ${glibc}/lib64/ld-linux-x86-64.so.2 \
|
exec ${glibc}/lib64/ld-linux-x86-64.so.2 \
|
||||||
$out/t-rex --no-watchdog \$@
|
$out/t-rex --no-watchdog \$@
|
||||||
'';
|
'';
|
||||||
in
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
pname = "t-rex-miner";
|
|
||||||
version = "0.26.5";
|
version = "0.26.5";
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
inherit version;
|
||||||
|
pname = "t-rex-miner";
|
||||||
src = fetchzip {
|
src = fetchzip {
|
||||||
url = "https://github.com/trexminer/T-Rex/releases/download/${version}/t-rex-${version}-linux.tar.gz";
|
url = "https://github.com/trexminer/T-Rex/releases/download/${version}/t-rex-${version}-linux.tar.gz";
|
||||||
sha256 = "sha256-eGOTfb03R2ck/6GMY6tPmTifYT9aVv3dNDQ5jRVlz58=";
|
sha256 = "sha256-eGOTfb03R2ck/6GMY6tPmTifYT9aVv3dNDQ5jRVlz58=";
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
{spicetify-nix, ...}: {pkgs, ...}: let
|
{spicetify-nix, ...}: {pkgs, ...}: let
|
||||||
sp-nix = spicetify-nix;
|
spicePkgs = spicetify-nix.packages.${pkgs.system}.default;
|
||||||
spicePkgs = sp-nix.packages.${pkgs.system}.default;
|
ex = spicePkgs.extensions;
|
||||||
in {
|
in {
|
||||||
nixpkgs.allowedUnfree = ["spotify"];
|
nixpkgs.allowedUnfree = ["spotify"];
|
||||||
imports = [sp-nix.nixosModule];
|
imports = [spicetify-nix.nixosModule];
|
||||||
programs.spicetify = {
|
programs.spicetify = {
|
||||||
spotifyPackage = pkgs.spotify-unwrapped;
|
spotifyPackage = pkgs.spotify-unwrapped;
|
||||||
spicetifyPackage = pkgs.spicetify-cli;
|
spicetifyPackage = pkgs.spicetify-cli;
|
||||||
enable = true;
|
enable = true;
|
||||||
enabledExtensions = with spicePkgs.extensions; [
|
enabledExtensions = [
|
||||||
adblock
|
ex.adblock
|
||||||
hidePodcasts
|
ex.hidePodcasts
|
||||||
shuffle
|
ex.shuffle
|
||||||
];
|
];
|
||||||
theme = spicePkgs.themes.Dribbblish;
|
theme = spicePkgs.themes.Dribbblish;
|
||||||
colorScheme = "custom";
|
colorScheme = "custom";
|
||||||
|
|
|
||||||
|
|
@ -42,8 +42,8 @@ _: {
|
||||||
echo 'EndSection' >> $out
|
echo 'EndSection' >> $out
|
||||||
echo >> $out
|
echo >> $out
|
||||||
'';
|
'';
|
||||||
oneMonitor = pkgs.writeText "1-monitor.conf" (lib.strings.concatStrings [(builtins.readFile xserverbase) (builtins.readFile "${self}/misc/1-monitor.conf")]);
|
oneMonitor = pkgs.writeText "1-monitor.conf" (lib.strings.concatStrings [(builtins.readFile xserverbase) (builtins.readFile (self + /misc/1-monitor.conf))]);
|
||||||
twoMonitor = pkgs.writeText "2-monitor.conf" (lib.strings.concatStrings [(builtins.readFile xserverbase) (builtins.readFile "${self}/misc/2-monitor.conf")]);
|
twoMonitor = pkgs.writeText "2-monitor.conf" (lib.strings.concatStrings [(builtins.readFile xserverbase) (builtins.readFile (self + /misc/2-monitor.conf))]);
|
||||||
in {
|
in {
|
||||||
boot = {
|
boot = {
|
||||||
kernelParams = ["amd_iommu=on" "iommu=pt" "vfio_iommu_type1.allow_unsafe_interrupts=1" "kvm.ignore_msrs=1"];
|
kernelParams = ["amd_iommu=on" "iommu=pt" "vfio_iommu_type1.allow_unsafe_interrupts=1" "kvm.ignore_msrs=1"];
|
||||||
|
|
@ -57,7 +57,6 @@ in {
|
||||||
patches =
|
patches =
|
||||||
old.patches
|
old.patches
|
||||||
++ [
|
++ [
|
||||||
# "${self}/misc/qemu.diff"
|
|
||||||
(pkgs.writeText "qemu.diff" ''
|
(pkgs.writeText "qemu.diff" ''
|
||||||
diff --git a/ui/input-linux.c b/ui/input-linux.c
|
diff --git a/ui/input-linux.c b/ui/input-linux.c
|
||||||
index e572a2e..a9d76ba 100644
|
index e572a2e..a9d76ba 100644
|
||||||
|
|
@ -111,7 +110,7 @@ in {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
systemd.tmpfiles.rules = let
|
systemd.tmpfiles.rules = let
|
||||||
xml = pkgs.writeText "Windows.xml" (builtins.readFile "${self}/misc/Windows.xml");
|
xml = pkgs.writeText "Windows.xml" (builtins.readFile (self + /misc/Windows.xml));
|
||||||
qemuHook = pkgs.writeShellScript "qemu-hook" ''
|
qemuHook = pkgs.writeShellScript "qemu-hook" ''
|
||||||
GUEST_NAME="$1"
|
GUEST_NAME="$1"
|
||||||
OPERATION="$2"
|
OPERATION="$2"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue