refactor: Move packages & wallpapers config into own nix files
My systems are single-user machines and the package configuration can go in the system-wide package list in full. This splits out the package list into a separate file and also moves the systemd units for wallpaper setting into a separate file.
This commit is contained in:
parent
aa5dcbc477
commit
202467e989
3 changed files with 101 additions and 54 deletions
|
@ -4,20 +4,15 @@
|
||||||
|
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
let rust-overlay = import nixpkgs-mozilla/rust-overlay.nix;
|
{
|
||||||
unstable = import <nixos-unstable> { config.allowUnfree = true; };
|
|
||||||
nixfd = import pkgs/nixfd.nix;
|
|
||||||
in {
|
|
||||||
imports =
|
imports =
|
||||||
[ # Include the results of the hardware scan.
|
[
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./local-configuration.nix
|
./local-configuration.nix
|
||||||
|
./packages.nix
|
||||||
|
./wallpapers.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Configure the Nix package manager
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
nixpkgs.overlays = [ rust-overlay ];
|
|
||||||
|
|
||||||
# Use the systemd-boot EFI boot loader.
|
# Use the systemd-boot EFI boot loader.
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
@ -27,14 +22,6 @@ in {
|
||||||
# Set your time zone.
|
# Set your time zone.
|
||||||
time.timeZone = "Europe/Oslo";
|
time.timeZone = "Europe/Oslo";
|
||||||
|
|
||||||
# List packages installed in system profile. To search by name, run:
|
|
||||||
# $ nix-env -qaP | grep wget
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
curl gnumake unzip openjdk gcc htop tree direnv tmux fish ripgrep
|
|
||||||
gnupg pass git manpages stdmanpages latest.rustChannels.stable.rust
|
|
||||||
nixfd
|
|
||||||
];
|
|
||||||
|
|
||||||
# Enable the X11 windowing system.
|
# Enable the X11 windowing system.
|
||||||
services.xserver.enable = true;
|
services.xserver.enable = true;
|
||||||
services.xserver.layout = "us,no";
|
services.xserver.layout = "us,no";
|
||||||
|
@ -73,42 +60,6 @@ in {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
uid = 1000;
|
uid = 1000;
|
||||||
shell = pkgs.fish;
|
shell = pkgs.fish;
|
||||||
packages = with pkgs; [
|
|
||||||
jetbrains.idea-community pavucontrol spotify xclip tdesktop
|
|
||||||
rofi rofi-pass alacritty i3lock unstable.firefox-beta-bin fd
|
|
||||||
tig kubernetes xfce.xfce4-screenshooter exa lxappearance-gtk3
|
|
||||||
numix-gtk-theme numix-icon-theme unstable.numix-cursor-theme
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Configure random setting of wallpapers
|
|
||||||
systemd.user.services.clone-wallpapers = {
|
|
||||||
description = "Clone wallpaper repository";
|
|
||||||
enable = true;
|
|
||||||
before = [ "feh-wp.service" "feh-wp.timer" ];
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "oneshot";
|
|
||||||
ExecStart = "${pkgs.fish}/bin/fish -c '${pkgs.coreutils}/bin/stat %h/wallpapers; or ${pkgs.git}/bin/git clone https://git.tazj.in/tazjin/wallpapers.git %h/wallpapers'";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.user.services.feh-wp = {
|
|
||||||
description = "Randomly set wallpaper via feh";
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "oneshot";
|
|
||||||
WorkingDirectory = "%h/wallpapers";
|
|
||||||
ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.fd}/bin/fd -atf | shuf | head -n1 | ${pkgs.findutils}/bin/xargs ${pkgs.feh}/bin/feh --bg-fill'";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.user.timers.feh-wp = {
|
|
||||||
description = "Set a random wallpaper every hour";
|
|
||||||
wantedBy = [ "timers.target" ];
|
|
||||||
|
|
||||||
timerConfig = {
|
|
||||||
OnActiveSec = "3second";
|
|
||||||
OnUnitActiveSec = "1hour";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
security.sudo.enable = true;
|
security.sudo.enable = true;
|
||||||
|
|
62
packages.nix
Normal file
62
packages.nix
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
# This file contains configuration for packages to install.
|
||||||
|
# It does not contain configuration for software that is already covered
|
||||||
|
# by other NixOS options (e.g. emacs)
|
||||||
|
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
let unstable = import <nixos-unstable> { config.allowUnfree = true; };
|
||||||
|
rust-overlay = import nixpkgs-mozilla/rust-overlay.nix;
|
||||||
|
in {
|
||||||
|
# Configure the Nix package manager
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
nixpkgs.overlays = [ rust-overlay ];
|
||||||
|
|
||||||
|
# ... and declare packages to be installed.
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
# Default nixos.* packages:
|
||||||
|
alacritty
|
||||||
|
curl
|
||||||
|
direnv
|
||||||
|
exa
|
||||||
|
fd
|
||||||
|
fish
|
||||||
|
gcc
|
||||||
|
git
|
||||||
|
gnumake
|
||||||
|
gnupg
|
||||||
|
htop
|
||||||
|
i3lock
|
||||||
|
jetbrains.idea-community
|
||||||
|
kubernetes
|
||||||
|
lxappearance-gtk3
|
||||||
|
manpages
|
||||||
|
numix-gtk-theme
|
||||||
|
numix-icon-theme
|
||||||
|
openjdk
|
||||||
|
pass
|
||||||
|
pavucontrol
|
||||||
|
ripgrep
|
||||||
|
rofi
|
||||||
|
rofi-pass
|
||||||
|
spotify
|
||||||
|
stdmanpages
|
||||||
|
tdesktop
|
||||||
|
tig
|
||||||
|
tmux
|
||||||
|
tree
|
||||||
|
unzip
|
||||||
|
xclip
|
||||||
|
xfce.xfce4-screenshooter
|
||||||
|
|
||||||
|
# nixos-unstable.* packages:
|
||||||
|
unstable.firefox-beta-bin
|
||||||
|
unstable.numix-cursor-theme
|
||||||
|
|
||||||
|
# Overlay packages:
|
||||||
|
latest.rustChannels.stable.rust
|
||||||
|
|
||||||
|
# Custom packages:
|
||||||
|
(import pkgs/nixfd.nix)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
34
wallpapers.nix
Normal file
34
wallpapers.nix
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
# Configuration for randomly setting wallpapers.
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Configure random setting of wallpapers
|
||||||
|
systemd.user.services.clone-wallpapers = {
|
||||||
|
description = "Clone wallpaper repository";
|
||||||
|
enable = true;
|
||||||
|
before = [ "feh-wp.service" "feh-wp.timer" ];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
ExecStart = "${pkgs.fish}/bin/fish -c '${pkgs.coreutils}/bin/stat %h/wallpapers; or ${pkgs.git}/bin/git clone https://git.tazj.in/tazjin/wallpapers.git %h/wallpapers'";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.user.services.feh-wp = {
|
||||||
|
description = "Randomly set wallpaper via feh";
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
WorkingDirectory = "%h/wallpapers";
|
||||||
|
ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.fd}/bin/fd -atf | shuf | head -n1 | ${pkgs.findutils}/bin/xargs ${pkgs.feh}/bin/feh --bg-fill'";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.user.timers.feh-wp = {
|
||||||
|
description = "Set a random wallpaper every hour";
|
||||||
|
wantedBy = [ "timers.target" ];
|
||||||
|
|
||||||
|
timerConfig = {
|
||||||
|
OnActiveSec = "3second";
|
||||||
|
OnUnitActiveSec = "1hour";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue