added some of my own scripts declaratively
Enabling systemd units and timers of my scripts
This commit is contained in:
@@ -3,18 +3,18 @@ let
|
|||||||
VERSION = "22.11";
|
VERSION = "22.11";
|
||||||
# HOME-MANAGER = builtins.fetchTarball
|
# HOME-MANAGER = builtins.fetchTarball
|
||||||
# "https://github.com/nix-community/home-manager/archive/master.tar.gz";
|
# "https://github.com/nix-community/home-manager/archive/master.tar.gz";
|
||||||
UNSTABLE_TARBALL = builtins.fetchTarball
|
UNSTABLE_TARBALL =
|
||||||
https://github.com/nixos/nixpkgs/tarball/master;
|
builtins.fetchTarball "https://github.com/nixos/nixpkgs/tarball/master";
|
||||||
unstable = import UNSTABLE_TARBALL {
|
unstable = import UNSTABLE_TARBALL { config = config.nixpkgs.config; };
|
||||||
config = config.nixpkgs.config;
|
nextcloud_scrapsync = pkgs.writeScriptBin "nextcloud_scrapsync"
|
||||||
};
|
(builtins.readFile ./scripts/nextcloud_scrapsync.sh);
|
||||||
in
|
manage_library = pkgs.writeScriptBin "manage_library"
|
||||||
{ # Remember to close this bracket at the end of the document
|
(builtins.readFile ./scripts/manage_library.fish);
|
||||||
|
ffmpeg4discord = pkgs.writeScriptBin "ffmpeg4discord"
|
||||||
|
(builtins.readFile ./scripts/ffmpeg4discord.py);
|
||||||
|
in { # Remember to close this bracket at the end of the document
|
||||||
|
|
||||||
imports = [
|
imports = [ ./hardware-configuration.nix <home-manager/nixos> ];
|
||||||
./hardware-configuration.nix
|
|
||||||
<home-manager/nixos>
|
|
||||||
];
|
|
||||||
|
|
||||||
networking.hostName = "workstation";
|
networking.hostName = "workstation";
|
||||||
|
|
||||||
@@ -25,9 +25,7 @@ time.timeZone = "America/Mexico_City";
|
|||||||
|
|
||||||
i18n = {
|
i18n = {
|
||||||
defaultLocale = "en_CA.UTF-8";
|
defaultLocale = "en_CA.UTF-8";
|
||||||
extraLocaleSettings = {
|
extraLocaleSettings = { LC_MONETARY = "es_MX.UTF-8"; };
|
||||||
LC_MONETARY = "es_MX.UTF-8";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
console = {
|
console = {
|
||||||
font = "Lat2-Terminus16";
|
font = "Lat2-Terminus16";
|
||||||
@@ -56,8 +54,7 @@ environment.gnome.excludePackages = (with pkgs; [
|
|||||||
gnome-connections
|
gnome-connections
|
||||||
# gnome-shell-extensions
|
# gnome-shell-extensions
|
||||||
baobab
|
baobab
|
||||||
])
|
]) ++ (with pkgs.gnome; [
|
||||||
++ (with pkgs.gnome; [
|
|
||||||
# totem
|
# totem
|
||||||
gedit
|
gedit
|
||||||
gnome-music
|
gnome-music
|
||||||
@@ -92,9 +89,7 @@ security.sudo = {
|
|||||||
# noPass = true;
|
# noPass = true;
|
||||||
# }];
|
# }];
|
||||||
|
|
||||||
nixpkgs.config = {
|
nixpkgs.config = { allowUnfree = true; };
|
||||||
allowUnfree = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users.jawz = {
|
users.users.jawz = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
@@ -182,6 +177,11 @@ xdg-ninja # help declutter $HOME
|
|||||||
torrenttools # create torrent files from the terminal!
|
torrenttools # create torrent files from the terminal!
|
||||||
lm_sensors # for extension, displays cpu temp
|
lm_sensors # for extension, displays cpu temp
|
||||||
|
|
||||||
|
# My own scripts
|
||||||
|
nextcloud_scrapsync
|
||||||
|
ffmpeg4discord
|
||||||
|
manage_library
|
||||||
|
|
||||||
# required by doom emacs, but still are rather useful.
|
# required by doom emacs, but still are rather useful.
|
||||||
fd # modern find, faster searches
|
fd # modern find, faster searches
|
||||||
fzf # fuzzy finder! super cool and useful
|
fzf # fuzzy finder! super cool and useful
|
||||||
@@ -237,12 +237,17 @@ gnome.gnome-tweaks # tweaks for the gnome desktop environment
|
|||||||
|
|
||||||
# Fonts
|
# Fonts
|
||||||
(nerdfonts.override {
|
(nerdfonts.override {
|
||||||
fonts = [ "Agave" "CascadiaCode" "SourceCodePro" "Ubuntu" "FiraCode" "Iosevka" ];
|
fonts = [
|
||||||
|
"Agave"
|
||||||
|
"CascadiaCode"
|
||||||
|
"SourceCodePro"
|
||||||
|
"Ubuntu"
|
||||||
|
"FiraCode"
|
||||||
|
"Iosevka"
|
||||||
|
];
|
||||||
})
|
})
|
||||||
symbola
|
symbola
|
||||||
(papirus-icon-theme.override {
|
(papirus-icon-theme.override { color = "adwaita"; })
|
||||||
color = "adwaita";
|
|
||||||
})
|
|
||||||
|
|
||||||
]) ++ (with pkgs.python310Packages; [
|
]) ++ (with pkgs.python310Packages; [
|
||||||
black # Python code formatter
|
black # Python code formatter
|
||||||
@@ -286,7 +291,8 @@ symbola
|
|||||||
markdownlint-cli
|
markdownlint-cli
|
||||||
prettier
|
prettier
|
||||||
pnpm
|
pnpm
|
||||||
]); }; # <--- end of package list
|
]);
|
||||||
|
}; # <--- end of package list
|
||||||
|
|
||||||
fonts.fontconfig.enable = true;
|
fonts.fontconfig.enable = true;
|
||||||
|
|
||||||
@@ -303,12 +309,15 @@ programs.fish = {
|
|||||||
enable = true;
|
enable = true;
|
||||||
# useBabelfish = true; This setting doens't work from inside home-manager
|
# useBabelfish = true; This setting doens't work from inside home-manager
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
ls = "exa --icons --group-directories-first --no-permissions --no-user --no-time";
|
ls =
|
||||||
|
"exa --icons --group-directories-first --no-permissions --no-user --no-time";
|
||||||
edit = "emacsclient -t";
|
edit = "emacsclient -t";
|
||||||
comic = "download -u jawz -i (cat $lc | fzf --multi --exact -i)";
|
comic = "download -u jawz -i (cat $lc | fzf --multi --exact -i)";
|
||||||
gallery = "download -u jawz -i (cat $lw | fzf --multi --exact -i)";
|
gallery = "download -u jawz -i (cat $lw | fzf --multi --exact -i)";
|
||||||
open_gallery = "open (find /mnt/disk2/scrapping/JawZ/gallery-dl -type d | fzf)";
|
open_gallery =
|
||||||
unique_extensions = "find . -type f | string match -r '([^.\/]+)\$' | sort -u";
|
"open (find /mnt/disk2/scrapping/JawZ/gallery-dl -type d | fzf)";
|
||||||
|
unique_extensions =
|
||||||
|
"find . -type f | string match -r '([^./]+)$' | sort -u";
|
||||||
cp = "cp -i";
|
cp = "cp -i";
|
||||||
mv = "mv -i";
|
mv = "mv -i";
|
||||||
mkdir = "mkdir -p";
|
mkdir = "mkdir -p";
|
||||||
@@ -375,7 +384,8 @@ programs = {
|
|||||||
config = {
|
config = {
|
||||||
# map-syntax = [ "*.jenkinsfile:Groovy" "*.props:Java Properties" ];
|
# map-syntax = [ "*.jenkinsfile:Groovy" "*.props:Java Properties" ];
|
||||||
pager = "less -FR";
|
pager = "less -FR";
|
||||||
theme = "base16"; };
|
theme = "base16";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
git = {
|
git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -408,7 +418,8 @@ xdg = {
|
|||||||
};
|
};
|
||||||
configFile = {
|
configFile = {
|
||||||
"wgetrc".source = ./dotfiles/wget/wgetrc;
|
"wgetrc".source = ./dotfiles/wget/wgetrc;
|
||||||
"configstore/update-notifier-npm-check.json".source = ./dotfiles/npm/update-notifier-npm-check.json;
|
"configstore/update-notifier-npm-check.json".source =
|
||||||
|
./dotfiles/npm/update-notifier-npm-check.json;
|
||||||
"npm/npmrc".source = ./dotfiles/npm/npmrc;
|
"npm/npmrc".source = ./dotfiles/npm/npmrc;
|
||||||
"gallery-dl/config.json".source = ./dotfiles/gallery-dl/config.json;
|
"gallery-dl/config.json".source = ./dotfiles/gallery-dl/config.json;
|
||||||
"htop/htoprc".source = ./dotfiles/htop/htoprc;
|
"htop/htoprc".source = ./dotfiles/htop/htoprc;
|
||||||
@@ -494,9 +505,7 @@ snapraid = {
|
|||||||
olderThan = 10;
|
olderThan = 10;
|
||||||
interval = "4:00";
|
interval = "4:00";
|
||||||
};
|
};
|
||||||
parityFiles = [
|
parityFiles = [ "/mnt/parity/snapraid.parity" ];
|
||||||
"/mnt/parity/snapraid.parity"
|
|
||||||
];
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
autosave 50
|
autosave 50
|
||||||
'';
|
'';
|
||||||
@@ -528,9 +537,7 @@ programs = {
|
|||||||
enable = true;
|
enable = true;
|
||||||
enableSSHSupport = true;
|
enableSSHSupport = true;
|
||||||
};
|
};
|
||||||
geary = {
|
geary = { enable = true; };
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
steam = {
|
steam = {
|
||||||
enable = true;
|
enable = true;
|
||||||
remotePlay.openFirewall = true;
|
remotePlay.openFirewall = true;
|
||||||
@@ -549,11 +556,7 @@ services = {
|
|||||||
fstrim.enable = true;
|
fstrim.enable = true;
|
||||||
btrfs.autoScrub = {
|
btrfs.autoScrub = {
|
||||||
enable = true;
|
enable = true;
|
||||||
fileSystems = [
|
fileSystems = [ "/" "/mnt/disk1" "/mnt/disk2" ];
|
||||||
"/"
|
|
||||||
"/mnt/disk1"
|
|
||||||
"/mnt/disk2"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
openssh = {
|
openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -578,17 +581,42 @@ systemd.services = {
|
|||||||
environment = {
|
environment = {
|
||||||
FILE = "/home/jawz/Development/Docker/docker-compose.yml";
|
FILE = "/home/jawz/Development/Docker/docker-compose.yml";
|
||||||
};
|
};
|
||||||
path = [
|
path = [ pkgs.docker-compose ];
|
||||||
pkgs.docker-compose
|
|
||||||
];
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
# Type = "simple";
|
# Type = "simple";
|
||||||
RestartSec = 30;
|
RestartSec = 30;
|
||||||
ExecStart = "${pkgs.docker-compose}/bin/docker-compose -f \${FILE} up --remove-orphans";
|
ExecStart =
|
||||||
|
"${pkgs.docker-compose}/bin/docker-compose -f \${FILE} up --remove-orphans";
|
||||||
ExecStop = "${pkgs.docker-compose}/bin/docker-compose -f \${FILE} down";
|
ExecStop = "${pkgs.docker-compose}/bin/docker-compose -f \${FILE} down";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
"nextcloud_scrapsync" = {
|
||||||
|
description = "Sync scrapped files with nextcloud";
|
||||||
|
wantedBy = [ "default.target" ];
|
||||||
|
path = [ pkgs.bash nextcloud_scrapsync ];
|
||||||
|
serviceConfig = {
|
||||||
|
RestartSec = 30;
|
||||||
|
ExecStart = "${nextcloud_scrapsync}/bin/nextcloud_scrapsync";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
systemd.timers = {
|
||||||
|
"nextcloud_scrapsync" = {
|
||||||
|
enable = true;
|
||||||
|
description = "Sync scrapped files with nextcloud";
|
||||||
|
wantedBy = [ "timers.target" ];
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = [
|
||||||
|
"*-*-* 01:32:00"
|
||||||
|
"*-*-* 08:32:00"
|
||||||
|
"*-*-* 14:32:00"
|
||||||
|
"*-*-* 20:32:00"
|
||||||
|
];
|
||||||
|
RandomizedDelaySec = 30;
|
||||||
|
Persistent = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
systemd.user.services = {
|
systemd.user.services = {
|
||||||
"HentaiAtHome" = {
|
"HentaiAtHome" = {
|
||||||
@@ -596,9 +624,7 @@ systemd.user.services = {
|
|||||||
restartIfChanged = true;
|
restartIfChanged = true;
|
||||||
description = "Run hentai@home server";
|
description = "Run hentai@home server";
|
||||||
wantedBy = [ "default.target" ];
|
wantedBy = [ "default.target" ];
|
||||||
path = [
|
path = [ pkgs.HentaiAtHome ];
|
||||||
pkgs.HentaiAtHome
|
|
||||||
];
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
RestartSec = 30;
|
RestartSec = 30;
|
||||||
@@ -606,6 +632,18 @@ systemd.user.services = {
|
|||||||
ExecStart = "${pkgs.HentaiAtHome}/bin/HentaiAtHome";
|
ExecStart = "${pkgs.HentaiAtHome}/bin/HentaiAtHome";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
"manage_library" = {
|
||||||
|
enable = true;
|
||||||
|
restartIfChanged = true;
|
||||||
|
description = "Run the manage library fish script";
|
||||||
|
wantedBy = [ "default.target" ];
|
||||||
|
path = [ pkgs.fish manage_library ];
|
||||||
|
serviceConfig = {
|
||||||
|
Restart = "on-failure";
|
||||||
|
RestartSec = 30;
|
||||||
|
ExecStart = "${manage_library}/bin/manage_library";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||||
@@ -615,7 +653,7 @@ networking.firewall.enable = false;
|
|||||||
|
|
||||||
system.copySystemConfiguration = true;
|
system.copySystemConfiguration = true;
|
||||||
nix.gc = {
|
nix.gc = {
|
||||||
enable = true;
|
automatic = true;
|
||||||
dates = "weekly";
|
dates = "weekly";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -11,11 +11,6 @@
|
|||||||
- [ ] Automatic updates
|
- [ ] Automatic updates
|
||||||
- [ ] Firewall ports
|
- [ ] Firewall ports
|
||||||
- [ ] Topgrade (perhaps unnecessary)
|
- [ ] Topgrade (perhaps unnecessary)
|
||||||
- [ ] SystemD services [4/5]
|
|
||||||
- [ ] Personal scripts [0/3]
|
|
||||||
- [ ] download
|
|
||||||
- [ ] Instagram
|
|
||||||
- [ ] startup tasks
|
|
||||||
- [ ] dotfiles [0/4]
|
- [ ] dotfiles [0/4]
|
||||||
- [ ] create a declarative Firefox or Librewolf install
|
- [ ] create a declarative Firefox or Librewolf install
|
||||||
- [ ] migrate config to home-manager
|
- [ ] migrate config to home-manager
|
||||||
@@ -53,6 +48,12 @@ let
|
|||||||
unstable = import UNSTABLE_TARBALL {
|
unstable = import UNSTABLE_TARBALL {
|
||||||
config = config.nixpkgs.config;
|
config = config.nixpkgs.config;
|
||||||
};
|
};
|
||||||
|
nextcloud_scrapsync = pkgs.writeScriptBin
|
||||||
|
"nextcloud_scrapsync" (builtins.readFile ./scripts/nextcloud_scrapsync.sh);
|
||||||
|
manage_library = pkgs.writeScriptBin
|
||||||
|
"manage_library" (builtins.readFile ./scripts/manage_library.fish);
|
||||||
|
ffmpeg4discord = pkgs.writeScriptBin
|
||||||
|
"ffmpeg4discord" (builtins.readFile ./scripts/ffmpeg4discord.py);
|
||||||
in
|
in
|
||||||
{ # Remember to close this bracket at the end of the document
|
{ # Remember to close this bracket at the end of the document
|
||||||
#+end_src
|
#+end_src
|
||||||
@@ -358,6 +359,12 @@ tree-sitter # code parsing, required by Doom emacs
|
|||||||
xdg-ninja # help declutter $HOME
|
xdg-ninja # help declutter $HOME
|
||||||
torrenttools # create torrent files from the terminal!
|
torrenttools # create torrent files from the terminal!
|
||||||
lm_sensors # for extension, displays cpu temp
|
lm_sensors # for extension, displays cpu temp
|
||||||
|
|
||||||
|
|
||||||
|
# My own scripts
|
||||||
|
nextcloud_scrapsync
|
||||||
|
ffmpeg4discord
|
||||||
|
manage_library
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** DEVELOPMENT PACKAGES
|
** DEVELOPMENT PACKAGES
|
||||||
@@ -894,6 +901,35 @@ systemd.services = {
|
|||||||
ExecStop = "${pkgs.docker-compose}/bin/docker-compose -f \${FILE} down";
|
ExecStop = "${pkgs.docker-compose}/bin/docker-compose -f \${FILE} down";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
"nextcloud_scrapsync" = {
|
||||||
|
description = "Sync scrapped files with nextcloud";
|
||||||
|
wantedBy = [ "default.target" ];
|
||||||
|
path = [
|
||||||
|
pkgs.bash
|
||||||
|
nextcloud_scrapsync
|
||||||
|
];
|
||||||
|
serviceConfig = {
|
||||||
|
RestartSec = 30;
|
||||||
|
ExecStart = "${nextcloud_scrapsync}/bin/nextcloud_scrapsync";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
systemd.timers = {
|
||||||
|
"nextcloud_scrapsync" = {
|
||||||
|
enable = true;
|
||||||
|
description = "Sync scrapped files with nextcloud";
|
||||||
|
wantedBy = [ "timers.target" ];
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar= [
|
||||||
|
"*-*-* 01:32:00"
|
||||||
|
"*-*-* 08:32:00"
|
||||||
|
"*-*-* 14:32:00"
|
||||||
|
"*-*-* 20:32:00"
|
||||||
|
];
|
||||||
|
RandomizedDelaySec = 30;
|
||||||
|
Persistent = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
systemd.user.services = {
|
systemd.user.services = {
|
||||||
"HentaiAtHome" = {
|
"HentaiAtHome" = {
|
||||||
@@ -911,6 +947,21 @@ systemd.user.services = {
|
|||||||
ExecStart = "${pkgs.HentaiAtHome}/bin/HentaiAtHome";
|
ExecStart = "${pkgs.HentaiAtHome}/bin/HentaiAtHome";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
"manage_library" = {
|
||||||
|
enable = true;
|
||||||
|
restartIfChanged = true;
|
||||||
|
description = "Run the manage library fish script";
|
||||||
|
wantedBy = [ "default.target" ];
|
||||||
|
path = [
|
||||||
|
pkgs.fish
|
||||||
|
manage_library
|
||||||
|
];
|
||||||
|
serviceConfig = {
|
||||||
|
Restart = "on-failure";
|
||||||
|
RestartSec = 30;
|
||||||
|
ExecStart = "${manage_library}/bin/manage_library";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@@ -934,7 +985,7 @@ accidentally delete configuration.nix.
|
|||||||
#+begin_src nix
|
#+begin_src nix
|
||||||
system.copySystemConfiguration = true;
|
system.copySystemConfiguration = true;
|
||||||
nix.gc = {
|
nix.gc = {
|
||||||
enable = true;
|
automatic = true;
|
||||||
dates = "weekly";
|
dates = "weekly";
|
||||||
};
|
};
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|||||||
Reference in New Issue
Block a user