Merge remote-tracking branch 'origin/nixos' into nixos-work
This commit is contained in:
commit
c7b7378750
10 changed files with 89 additions and 72 deletions
12
flake.nix
12
flake.nix
|
|
@ -109,11 +109,12 @@
|
|||
self.overlay
|
||||
];
|
||||
|
||||
# overlays = utils.lib.exportOverlays {
|
||||
# inherit (self) pkgs inputs;
|
||||
# };
|
||||
|
||||
overlays.default = self.overlay;
|
||||
overlays = utils.lib.exportOverlays
|
||||
{
|
||||
inherit (self) pkgs inputs;
|
||||
} // {
|
||||
default = self.overlay;
|
||||
};
|
||||
|
||||
/*
|
||||
╔══════════════════════════════════════════════════════════╗
|
||||
|
|
@ -146,7 +147,6 @@
|
|||
hosts.nixos-laptop.modules = [
|
||||
./hosts/nixos-laptop
|
||||
self.nixosModules.desktop
|
||||
self.nixosModules.gaming
|
||||
self.nixosModules.personal
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
{ lib, pkgs, ... }:
|
||||
{ lib, ... }:
|
||||
|
||||
with lib;
|
||||
{
|
||||
my = {
|
||||
services.openconnect.enable = true;
|
||||
services = {
|
||||
openconnect.enable = true;
|
||||
synology-drive.enable = true;
|
||||
};
|
||||
programs = {
|
||||
ssh.includeSecrets = mkDefault [ ../../secrets/ssh-home.age ];
|
||||
git.signing = mkDefault true;
|
||||
|
|
@ -57,8 +60,4 @@ with lib;
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
synology-drive-client
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,31 +2,9 @@
|
|||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
# nix
|
||||
nixpkgs-review
|
||||
|
||||
# ripping
|
||||
abcde
|
||||
handbrake
|
||||
picard
|
||||
|
||||
# other
|
||||
anki
|
||||
calibre
|
||||
jellyfin-media-player
|
||||
keepassxc
|
||||
stable.libreoffice # HACK to fix build error
|
||||
pavucontrol
|
||||
stable.signal-desktop
|
||||
tlaplusToolbox
|
||||
vlc
|
||||
thunderbird
|
||||
plantuml
|
||||
|
||||
jetbrains.pycharm-professional
|
||||
|
||||
synology-drive-client
|
||||
|
||||
texlive.combined.scheme-full
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ in
|
|||
};
|
||||
startupPrograms = [
|
||||
"randomWallpaper"
|
||||
"${pkgs.synology-drive-client}/bin/synology-drive"
|
||||
];
|
||||
extraConfig = builtins.readFile ./bspwmrc;
|
||||
};
|
||||
|
|
@ -89,7 +88,6 @@ in
|
|||
feh
|
||||
pamixer
|
||||
playerctl
|
||||
synology-drive-client
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -224,6 +224,5 @@ in
|
|||
bindm = $mainMod, mouse:272, movewindow
|
||||
bindm = $mainMod, mouse:273, resizewindow
|
||||
|
||||
exec-once=synology-drive
|
||||
exec-once=randomWallpaper
|
||||
''
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ in
|
|||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
package = hyprland;
|
||||
recommendedEnvironment = true;
|
||||
extraConfig = import ./config.nix args;
|
||||
};
|
||||
};
|
||||
|
|
@ -59,7 +60,7 @@ in
|
|||
# start using systemd service
|
||||
systemd = {
|
||||
enable = true;
|
||||
target = "hyprland-session.target";
|
||||
target = "graphical-session.target";
|
||||
};
|
||||
|
||||
settings = {
|
||||
|
|
@ -87,11 +88,11 @@ in
|
|||
events = [
|
||||
{
|
||||
event = "before-sleep";
|
||||
command = "${pkgs.swaylock-effects}/bin/swaylock -fF";
|
||||
command = "${pkgs.swaylock}/bin/swaylock -fF";
|
||||
}
|
||||
{
|
||||
event = "lock";
|
||||
command = "${pkgs.swaylock-effects}/bin/swaylock -fF";
|
||||
command = "${pkgs.swaylock}/bin/swaylock -fF";
|
||||
}
|
||||
];
|
||||
timeouts = [
|
||||
|
|
@ -105,10 +106,8 @@ in
|
|||
command = "${pkgs.systemd}/bin/loginctl lock-session";
|
||||
}
|
||||
];
|
||||
systemdTarget = "hyprland-session.target";
|
||||
};
|
||||
|
||||
# start swayidle as part of hyprland, not sway
|
||||
systemd.user.services.swayidle.Install.WantedBy = lib.mkForce [ "hyprland-session.target" ];
|
||||
};
|
||||
|
||||
# adds pam module for swaylock
|
||||
|
|
@ -116,27 +115,28 @@ in
|
|||
|
||||
|
||||
# start hyprpaper daemon using systemd unit (to set wallpaper)
|
||||
systemd.user.services.hyprpaper = {
|
||||
enable = true;
|
||||
path = [ pkgs.hyprpaper ];
|
||||
wantedBy = [ "hyprland-session.target" ];
|
||||
after = [ "hyprland-session.target" ];
|
||||
script = "hyprpaper";
|
||||
};
|
||||
|
||||
# set hyprpaper conf (for setting initial background)
|
||||
home-manager.users.moritz.xdg.configFile."hypr/hyprpaper.conf" = {
|
||||
text =
|
||||
let
|
||||
setWallpaper = wallpaper: ''
|
||||
systemd.user.services.hyprpaper =
|
||||
let
|
||||
wallpaper = "/home/moritz/.config/wallpapers/a_short_walk.png";
|
||||
config = pkgs.writeTextFile {
|
||||
name = "hyprpaper.conf";
|
||||
text = ''
|
||||
preload = ${wallpaper}
|
||||
wallpaper = ,${wallpaper}
|
||||
'';
|
||||
in
|
||||
setWallpaper "/home/moritz/.config/wallpapers/a_short_walk.png";
|
||||
onChange = "${pkgs.systemd}/bin/systemctl restart --user hyprpaper.service";
|
||||
};
|
||||
|
||||
};
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
partOf = [ "graphical-session.target" ];
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
after = [ "graphical-session.target" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.hyprpaper}/bin/hyprpaper -c ${config}";
|
||||
RestartSec = "1s";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
};
|
||||
|
||||
# only consider graphical-session.target started when hyprland-sesstion.target is reached
|
||||
systemd.user.targets.hyprland-session = {
|
||||
|
|
@ -144,6 +144,17 @@ in
|
|||
before = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
systemd.user.services.xdg-desktop-portal-hyprland = {
|
||||
after = [ "hyprland-session.target" ];
|
||||
wantedBy = [ "hyprland-session.target" ];
|
||||
};
|
||||
|
||||
home-manager.users.moritz.systemd.user.services.nextcloud-client = {
|
||||
Service = {
|
||||
RestartSec = "1s";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
};
|
||||
|
||||
# add user packages for wayland and hyprland in particular
|
||||
users.users.moritz.packages = with pkgs; [
|
||||
|
|
@ -206,7 +217,7 @@ in
|
|||
# dekstop portal (for screensharing)
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
wlr.enable = true;
|
||||
wlr.enable = mkForce false;
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-hyprland ];
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,6 +5,14 @@ require("which-key").register({
|
|||
b = { "<cmd>Telescope buffers<cr>", "List buffers" },
|
||||
d = { "<cmd>bd<cr>", "Delete buffer" },
|
||||
},
|
||||
}, { prefix = "<leader>" })
|
||||
require("which-key").register({
|
||||
["["] = {
|
||||
b = { "<cmd>bprevious<cr>", "Previous buffer" },
|
||||
},
|
||||
["]"] = {
|
||||
b = { "<cmd>bnext<cr>", "Next buffer" },
|
||||
},
|
||||
})
|
||||
|
||||
-- window
|
||||
|
|
@ -17,14 +25,6 @@ require("which-key").register({
|
|||
d = { "<C-w>c", "Delete window" },
|
||||
},
|
||||
}, { prefix = "<leader>" })
|
||||
require("which-key").register({
|
||||
["["] = {
|
||||
b = { "<cmd>bprevious<cr>", "Previous buffer" },
|
||||
},
|
||||
["]"] = {
|
||||
b = { "<cmd>bnext<cr>", "Next buffer" },
|
||||
},
|
||||
})
|
||||
|
||||
-- tab
|
||||
require("which-key").register({
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ in
|
|||
command = "systemctl --user restart waybar";
|
||||
always = true;
|
||||
}
|
||||
{ command = "synology-drive"; }
|
||||
{ command = "randomWallpaper"; }
|
||||
];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
{
|
||||
imports = [
|
||||
./dunst.nix
|
||||
./gammastep.nix
|
||||
./kdeconnect.nix
|
||||
./mullvad.nix
|
||||
./openconnect.nix
|
||||
./picom.nix
|
||||
./printing.nix
|
||||
./gammastep.nix
|
||||
./synology-drive.nix
|
||||
./wireguard.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
32
modules/services/synology-drive.nix
Normal file
32
modules/services/synology-drive.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.services.synology-drive;
|
||||
in
|
||||
{
|
||||
options.my.services.synology-drive = {
|
||||
enable = mkEnableOption "synology-drive";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.synology-drive-client;
|
||||
description = "The package to use for synology-drive";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.user.services.synology-drive = {
|
||||
after = [ "graphical-session.target" "network.target" ];
|
||||
partOf = [ "graphical-session.target" ];
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
serviceConfig = {
|
||||
ExitType = "cgroup";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "1s";
|
||||
ExecStartPre = "${pkgs.coreutils}/bin/rm -rf %h/.SynologyDrive/SynologyDrive.app %h/.SynologyDrive/cloud-connect.pid";
|
||||
ExecStart = "${cfg.package}/bin/synology-drive";
|
||||
};
|
||||
};
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue