Make redshift nixos module

This commit is contained in:
Julian Mutter 2024-10-09 15:28:41 +02:00
parent 9dfe8aa9f2
commit d5ca488864
4 changed files with 43 additions and 44 deletions

View File

@ -43,7 +43,6 @@
nix-helper.enable = true;
desktop.enable = true;
gammastep.enable = true;
};
home.packages =

View File

@ -0,0 +1,38 @@
{
# Snowfall Lib provides a customized `lib` instance with access to your flake's library
# as well as the libraries available from your flake's inputs.
lib,
# An instance of `pkgs` with your overlays and packages applied is also available.
pkgs,
# You also have access to your flake's inputs.
inputs,
# Additional metadata is provided by Snowfall Lib.
namespace, # The namespace used for your flake, defaulting to "internal" if not set.
system, # The system architecture for this host (eg. `x86_64-linux`).
target, # The Snowfall Lib target for this system (eg. `x86_64-iso`).
format, # A normalized name for the system target (eg. `iso`).
virtual, # A boolean to determine whether this system is a virtual target using nixos-generators.
systems, # An attribute map of your defined hosts.
# All other arguments come from the module system.
config,
...
}:
let
cfg = config.modules.redshift;
in
{
options.modules.redshift = {
enable = lib.mkOption { default = false; };
};
config = lib.mkIf cfg.enable {
# Set location used by redshift
location.provider = "manual";
location.latitude = 47.92;
location.longitude = 10.12;
services.redshift.enable = true;
};
}

View File

@ -48,6 +48,7 @@
i3.enable = true;
gdm.enable = true;
redshift.enable = true;
# wayland.enable = true;
# hyprland.enable = true;
@ -75,13 +76,6 @@
# Enable touchpad support (enabled default in most desktopManager).
services.libinput.enable = true;
# systemd.services."wg-quick@julian".enable = true;
xdg.portal.enable = true;
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
xdg.portal.config.common.default = "*"; # Use first portal implementation found
# networking.wireguard.enable = true;
# This interface is started on boot / switch
networking.wg-quick.interfaces = {
julian = {
@ -90,17 +84,10 @@
};
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = false;
services.flatpak.enable = true;
# services.emacs.enable = true;
# services.gnome.gnome-keyring.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
virtualisation.docker.enable = true;
# Packages needed as root
environment.systemPackages = with pkgs; [
@ -116,8 +103,6 @@
brightnessctl
];
virtualisation.docker.enable = true;
# ======================== DO NOT CHANGE THIS ========================
system.stateVersion = "24.05";
# ======================== DO NOT CHANGE THIS ========================

View File

@ -38,14 +38,9 @@
xdg-portal.enable = true;
polkit.enable = true;
keyring.enable = true;
redshift.enable = true;
};
# Set location used by redshift
location.provider = "manual";
location.latitude = 47.92;
location.longitude = 10.12;
services.redshift.enable = true;
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_470;
# hardware.nvidia.modesetting.enable = true; # for wayland
@ -58,40 +53,22 @@
# services.avahi.nssmdns = true;
services.printing.drivers = with pkgs; [ gutenprint ];
# users.groups.wolfi = { gid = 1001; };
# users.users.wolfi = {
# isNormalUser = true;
# description = "Wolfi";
# uid = 1001;
# group = "wolfi";
# shell = pkgs.fish;
# extraGroups = [ "networkmanager" "wheel" ];
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = false;
services.flatpak.enable = true;
# Smart card reader
services.pcscd.enable = true;
# services.emacs.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
virtualisation.docker.enable = true;
# Packages needed as root
environment.systemPackages = with pkgs; [
vim
htop
mc
gparted-xhost # needs to be installed as system package so it can be actually opened
];
virtualisation.docker.enable = true;
# ======================== DO NOT CHANGE THIS ========================
system.stateVersion = "22.11";
# ======================== DO NOT CHANGE THIS ========================