-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix.old
88 lines (82 loc) · 2.66 KB
/
flake.nix.old
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#{ pkgs, lib, config, ...}:
{
description = "Manage KDE Plasma with Home Manager";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
home-manager.url = "github:nix-community/home-manager/release-23.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
# options = {
# };
outputs = inputs@{ self, ... }:
let
pkgs = inputs.nixpkgs; # Accessing nixpkgs via inputs
lib = pkgs.lib; # Accessing lib from nixpkgs
config = {}; # Initialize an empty config
# Systems that can run tests:
supportedSystems = [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
];
# Function to generate a set based on supported systems:
forAllSystems = inputs.nixpkgs.lib.genAttrs supportedSystems;
# Attribute set of nixpkgs for each system:
nixpkgsFor = forAllSystems (system:
import inputs.nixpkgs { inherit system; });
in
{
# Function to create wallpaper-changer module for specified folder:
homeManagerModules.wallpaper-changer = folder: { ... }: {
imports = [ ./modules ];
config = {
homeManagerConfiguration = {
scripts = {
"change-wallpaper.sh" = {
text = ''
#!/bin/sh
while true; do
# Command to change wallpaper
# For example, using feh to change wallpaper:
feh --bg-fill "${folder}"
sleep 60 # Change wallpaper every minute (60 seconds)
done
'';
executable = true;
};
};
};
systemd.user.services.change-wallpaper = {
description = "Change wallpaper every minute";
wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "";
# ExecStart = "/bin/sh -c ${config.homeManagerConfiguration.scripts.change-wallpaper.sh.text}";
Restart = "on-failure";
};
};
};
};
};
in
{
homeManagerModules.wallpaper-changer = { wallpaperChanger }: {};
packages = forAllSystems (system:
let pkgs = nixpkgsFor.${system}; in
{
wallpaper = pkgs.writeShellApplication {
name = "wallpaper";
test = "";
};
apps = forAllSystems (system: {
default = self.packages.${system}.wallpaper;
wallpaper = {
type = "app";
program = "";
};
});
}
);
};
}