From 286f70981bad64a8a0521afcab0d7967b360de60 Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Mon, 13 Sep 2021 16:06:18 +0200 Subject: [PATCH] New onedrive module + various updates --- custom/default.nix | 3 +-- home.nix | 4 +++- modules/kakoune.nix | 17 +++++++++-------- modules/onedrive.nix | 21 +++++++++++++++++++++ modules/shell_aliases.nix | 11 +++++++---- nixos/base.nix | 7 +++++++ nixos/mind.nix | 20 ++++++++++++++++++++ 7 files changed, 68 insertions(+), 15 deletions(-) create mode 100644 modules/onedrive.nix create mode 100644 nixos/mind.nix diff --git a/custom/default.nix b/custom/default.nix index 927b8e7..4f22b25 100644 --- a/custom/default.nix +++ b/custom/default.nix @@ -3,8 +3,7 @@ }: let - callPackage = pkgs.lib.callPackageWith (pkgs // self); - self = { + self = with pkgs; { lockscreen = callPackage ./lockscreen {}; update-background = callPackage ./update-background {}; cocktail-bar-cli = callPackage ./cocktail-bar-cli {}; diff --git a/home.nix b/home.nix index 90ad304..80cd48a 100644 --- a/home.nix +++ b/home.nix @@ -64,6 +64,7 @@ in google-chrome gucharmap htop + hyperspace-cli jetbrains.datagrip keepassxc krita @@ -72,7 +73,7 @@ in megacmd mpv neofetch - nix-prefetch-git + nix-prefetch-scripts obsidian openvpn pavucontrol @@ -153,6 +154,7 @@ in # ./modules/nix-index.nix ./modules/noti.nix ./modules/obs-studio.nix + ./modules/onedrive.nix # ./modules/pazi.nix # ./modules/picom.nix ./modules/polybar.nix diff --git a/modules/kakoune.nix b/modules/kakoune.nix index 4093966..221b30b 100644 --- a/modules/kakoune.nix +++ b/modules/kakoune.nix @@ -22,6 +22,8 @@ let pythonPlugins = with pkgs.python38Packages; [ black pyls-black + pyls-isort + pyls-mypy python-language-server ]; javascriptPlugins = with pkgs; [ @@ -146,15 +148,15 @@ in set-face global error rgb:${normal.red},default set-face global keyword rgb:${normal.blue},default set-face global operator rgb:${normal.blue},default - set-face global attribute rgb:${dark.blue},default + set-face global attribute rgb:${bright.blue},default set-face global comment rgb:${bright.blue},default set-face global meta rgb:${normal.yellow},default set-face global Default rgb:${normal.white},default - set-face global PrimarySelection rgb:${normal.black},rgb:${normal.white} - set-face global SecondarySelection rgb:${bright.white},rgb:${bright.black} - set-face global PrimaryCursor rgb:${dark.black},rgb:${normal.yellow} - set-face global SecondaryCursor rgb:${dark.black},rgb:${dark.white} - set-face global MenuForeground rgb:${dark.white},rgb:${dark.white} + set-face global PrimarySelection rgb:${normal.black},rgb:${dark.yellow} + set-face global SecondarySelection rgb:${normal.black},rgb:${dark.white} + set-face global PrimaryCursor rgb:${normal.black},rgb:${normal.yellow} + set-face global SecondaryCursor rgb:${normal.black},rgb:${normal.white} + set-face global MenuForeground rgb:${normal.white},rgb:${bright.black} set-face global MenuBackground default,rgb:${normal.black} set-face global MenuInfo default,rgb:${normal.black} set-face global Information rgb:${dark.black},rgb:${normal.cyan} @@ -385,7 +387,7 @@ in [language.python] filetypes = ["python"] roots = ["requirements.txt", "setup.py", ".git", ".hg"] - command = "${pkgs.python-language-server}/bin/pyls" + command = "${pkgs.python-language-server}/bin/python-language-server" offset_encoding = "utf-8" [language.python.settings] # See https://github.com/palantir/python-language-server#configuration @@ -536,5 +538,4 @@ in }; in builtins.toPath "${desktopItem}/share/applications/kakoune.desktop"; - } diff --git a/modules/onedrive.nix b/modules/onedrive.nix new file mode 100644 index 0000000..ddfe45a --- /dev/null +++ b/modules/onedrive.nix @@ -0,0 +1,21 @@ +{ pkgs, ... }: +let + onedriveCmd = "${pkgs.onedrive}/bin/onedrive --monitor"; +in +{ + systemd.user.services."onedrive" = { + Unit = { + Description = "OneDrive synchronization service"; + After = [ "network.target" ]; + PartOf = [ "default.target" ]; + }; + Install = { + WantedBy = [ "default.target" ]; + }; + Service = { + ExecStart = onedriveCmd; + Restart = "always"; + RestartSec = "30s"; + }; + }; +} diff --git a/modules/shell_aliases.nix b/modules/shell_aliases.nix index 67336fe..68f6772 100644 --- a/modules/shell_aliases.nix +++ b/modules/shell_aliases.nix @@ -1,12 +1,15 @@ { pkgs, ... }: let shellAliases = { + "dk" = "docker"; + "hm" = "home-manager"; + "jc" = "sudo journalctl"; + "jcu" = "journalctl --user"; + "nf" = "find /nix/store/ -maxdepth 1 | grep"; + "ns" = "nix search nixpkgs"; + "nS" = "nix-shell"; "sc" = "systemctl"; "scu" = "systemctl --user"; - "hm" = "home-manager"; - "ns" = "nix search nixpkgs"; - "nf" = "find /nix/store/ -maxdepth 1 | grep"; - "dk" = "docker"; }; in { diff --git a/nixos/base.nix b/nixos/base.nix index 329d06f..150f7af 100644 --- a/nixos/base.nix +++ b/nixos/base.nix @@ -7,6 +7,7 @@ ./pentablet.nix ./pro_audio.nix ./defcon.nix + ./mind.nix ]; # Use the systemd-boot EFI boot loader. @@ -220,6 +221,12 @@ # }; }; + # SMART + services.smartd = { + enable = true; + notifications.x11.enable = true; + }; + # Clamav services.clamav = { daemon.enable = true; updater.enable = true; }; diff --git a/nixos/mind.nix b/nixos/mind.nix new file mode 100644 index 0000000..dda7a42 --- /dev/null +++ b/nixos/mind.nix @@ -0,0 +1,20 @@ +{ + services.postgresql = { + enable = true; + ensureDatabases = [ + "mfh" + ]; + ensureUsers = [ + { + name = "bertof"; + ensurePermissions = { + "DATABASE \"mfh\"" = "ALL PRIVILEGES"; + }; + } + ]; + }; + + services.apache-kafka = { + enable = true; + }; +}