Skip to content

Commit

Permalink
modules/nixos wrap modules in config = {}
Browse files Browse the repository at this point in the history
  • Loading branch information
alyraffauf committed Jan 19, 2025
1 parent a48d955 commit 0de07db
Show file tree
Hide file tree
Showing 20 changed files with 595 additions and 555 deletions.
26 changes: 14 additions & 12 deletions modules/locale/en-us/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@
lib,
...
}: {
i18n = {
defaultLocale = lib.mkDefault "en_US.UTF-8";
config = {
i18n = {
defaultLocale = lib.mkDefault "en_US.UTF-8";

extraLocaleSettings = {
LC_ADDRESS = config.i18n.defaultLocale;
LC_IDENTIFICATION = config.i18n.defaultLocale;
LC_MEASUREMENT = config.i18n.defaultLocale;
LC_MONETARY = config.i18n.defaultLocale;
LC_NAME = config.i18n.defaultLocale;
LC_NUMERIC = config.i18n.defaultLocale;
LC_PAPER = config.i18n.defaultLocale;
LC_TELEPHONE = config.i18n.defaultLocale;
LC_TIME = config.i18n.defaultLocale;
extraLocaleSettings = {
LC_ADDRESS = config.i18n.defaultLocale;
LC_IDENTIFICATION = config.i18n.defaultLocale;
LC_MEASUREMENT = config.i18n.defaultLocale;
LC_MONETARY = config.i18n.defaultLocale;
LC_NAME = config.i18n.defaultLocale;
LC_NUMERIC = config.i18n.defaultLocale;
LC_PAPER = config.i18n.defaultLocale;
LC_TELEPHONE = config.i18n.defaultLocale;
LC_TIME = config.i18n.defaultLocale;
};
};
};
}
68 changes: 35 additions & 33 deletions modules/nixos/desktop/default.nix
Original file line number Diff line number Diff line change
@@ -1,48 +1,50 @@
{pkgs, ...}: {
boot = {
consoleLogLevel = 0;
initrd.verbose = false;
plymouth.enable = true;
};

environment.sessionVariables.NIXOS_OZONE_WL = "1";
programs.system-config-printer.enable = true;
config = {
boot = {
consoleLogLevel = 0;
initrd.verbose = false;
plymouth.enable = true;
};

services = {
gnome.gnome-keyring.enable = true;
gvfs.enable = true; # Mount, trash, etc.
libinput.enable = true;
environment.sessionVariables.NIXOS_OZONE_WL = "1";
programs.system-config-printer.enable = true;

pipewire = {
enable = true;
services = {
gnome.gnome-keyring.enable = true;
gvfs.enable = true; # Mount, trash, etc.
libinput.enable = true;

alsa = {
pipewire = {
enable = true;
support32Bit = true;
};

pulse.enable = true;
};
alsa = {
enable = true;
support32Bit = true;
};

printing.enable = true;
pulse.enable = true;
};

pulseaudio = {
package = pkgs.pulseaudioFull; # Use extra Bluetooth codecs like aptX
printing.enable = true;

extraConfig = ''
load-module module-bluetooth-discover
load-module module-bluetooth-policy
load-module module-switch-on-connect
'';
pulseaudio = {
package = pkgs.pulseaudioFull; # Use extra Bluetooth codecs like aptX

support32Bit = true;
};
extraConfig = ''
load-module module-bluetooth-discover
load-module module-bluetooth-policy
load-module module-switch-on-connect
'';

support32Bit = true;
};

system-config-printer.enable = true;
system-config-printer.enable = true;

xserver = {
enable = true;
excludePackages = with pkgs; [xterm];
xserver = {
enable = true;
excludePackages = with pkgs; [xterm];
};
};
};
}
16 changes: 9 additions & 7 deletions modules/nixos/desktop/gnome/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
}: {
imports = [self.nixosModules.nixos-desktop];

home-manager.sharedModules = [
{
ar.home.desktop.gnome.enable = lib.mkDefault true;
}
];
config = {
home-manager.sharedModules = [
{
ar.home.desktop.gnome.enable = lib.mkDefault true;
}
];

programs.firefox.policies.Preferences."browser.tabs.inTitlebar" = lib.mkIf (config.programs.firefox.enable) 1;
programs.firefox.policies.Preferences."browser.tabs.inTitlebar" = lib.mkIf (config.programs.firefox.enable) 1;

services.xserver.desktopManager.gnome.enable = true;
services.xserver.desktopManager.gnome.enable = true;
};
}
28 changes: 15 additions & 13 deletions modules/nixos/desktop/hyprland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@
}: {
imports = [self.nixosModules.nixos-desktop];

home-manager.sharedModules = [
{
ar.home.desktop.hyprland.enable = lib.mkDefault true;
}
];
config = {
home-manager.sharedModules = [
{
ar.home.desktop.hyprland.enable = lib.mkDefault true;
}
];

programs = {
gnupg.agent.pinentryPackage = pkgs.pinentry-gnome3;
hyprland.enable = true;
hyprlock.enable = true;
};
programs = {
gnupg.agent.pinentryPackage = pkgs.pinentry-gnome3;
hyprland.enable = true;
hyprlock.enable = true;
};

services = {
dbus.packages = [pkgs.gcr];
udev.packages = [pkgs.swayosd];
services = {
dbus.packages = [pkgs.gcr];
udev.packages = [pkgs.swayosd];
};
};
}
60 changes: 31 additions & 29 deletions modules/nixos/desktop/kde/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,40 @@
}: {
imports = [self.nixosModules.nixos-desktop];

# environment.plasma6.excludePackages = lib.attrsets.attrValues {
# inherit
# (pkgs.kdePackages)
# elisa
# gwenview
# krdp
# okular
# oxygen
# ;
# };
config = {
# environment.plasma6.excludePackages = lib.attrsets.attrValues {
# inherit
# (pkgs.kdePackages)
# elisa
# gwenview
# krdp
# okular
# oxygen
# ;
# };

environment.systemPackages = with pkgs; [
kdePackages.sddm-kcm
maliit-keyboard
];
environment.systemPackages = with pkgs; [
kdePackages.sddm-kcm
maliit-keyboard
];

home-manager.sharedModules = [
{
ar.home.desktop.kde.enable = lib.mkDefault true;
}
];
home-manager.sharedModules = [
{
ar.home.desktop.kde.enable = lib.mkDefault true;
}
];

programs.dconf.profiles.user.databases = [
{
settings = {
"org.maliit.keyboard.maliit" = {
key-press-haptic-feedback = true;
theme = "BreezeDark";
programs.dconf.profiles.user.databases = [
{
settings = {
"org.maliit.keyboard.maliit" = {
key-press-haptic-feedback = true;
theme = "BreezeDark";
};
};
};
}
];
}
];

services.desktopManager.plasma6.enable = true;
services.desktopManager.plasma6.enable = true;
};
}
26 changes: 14 additions & 12 deletions modules/nixos/profiles/autoUpgrade/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@
lib,
...
}: {
system.autoUpgrade = {
enable = true;
allowReboot = lib.mkDefault true;
dates = "02:00";
flags = ["--accept-flake-config"];
flake = config.environment.variables.FLAKE or "github:alyraffauf/nixcfg";
operation = lib.mkDefault "boot";
persistent = true;
randomizedDelaySec = "60min";
config = {
system.autoUpgrade = {
enable = true;
allowReboot = lib.mkDefault true;
dates = "02:00";
flags = ["--accept-flake-config"];
flake = config.environment.variables.FLAKE or "github:alyraffauf/nixcfg";
operation = lib.mkDefault "boot";
persistent = true;
randomizedDelaySec = "60min";

rebootWindow = {
lower = "02:00";
upper = "06:00";
rebootWindow = {
lower = "02:00";
upper = "06:00";
};
};
};
}
90 changes: 46 additions & 44 deletions modules/nixos/profiles/base/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,66 +3,68 @@
pkgs,
...
}: {
boot = {
initrd.systemd.enable = lib.mkDefault true;
config = {
boot = {
initrd.systemd.enable = lib.mkDefault true;

loader = {
efi.canTouchEfiVariables = lib.mkDefault true;
loader = {
efi.canTouchEfiVariables = lib.mkDefault true;

systemd-boot = {
enable = lib.mkDefault true;
configurationLimit = lib.mkDefault 10;
systemd-boot = {
enable = lib.mkDefault true;
configurationLimit = lib.mkDefault 10;
};
};
};
};

environment = {
systemPackages = with pkgs; [
git
htop
(inxi.override {withRecommends = true;})
python3
];
environment = {
systemPackages = with pkgs; [
git
htop
(inxi.override {withRecommends = true;})
python3
];

variables.FLAKE = lib.mkDefault "github:alyraffauf/nixcfg";
};
variables.FLAKE = lib.mkDefault "github:alyraffauf/nixcfg";
};

programs = {
dconf.enable = true; # Needed for home-manager
programs = {
dconf.enable = true; # Needed for home-manager

gnupg.agent = {
enable = true;
enableSSHSupport = true;
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};

nh.enable = true;
};

nh.enable = true;
};
networking.networkmanager.enable = true;

networking.networkmanager.enable = true;
security = {
polkit.enable = true;
rtkit.enable = true;
};

security = {
polkit.enable = true;
rtkit.enable = true;
};
services = {
avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;

services = {
avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
publish = {
enable = true;
addresses = true;
userServices = true;
workstation = true;
};
};

publish = {
openssh = {
enable = true;
addresses = true;
userServices = true;
workstation = true;
openFirewall = true;
settings.PasswordAuthentication = false;
};
};

openssh = {
enable = true;
openFirewall = true;
settings.PasswordAuthentication = false;
};
};
}
Loading

0 comments on commit 0de07db

Please sign in to comment.