[NixOS] Move to home-manager

This commit is contained in:
Ivan Malison 2021-07-13 03:37:03 -06:00
parent 417524f92a
commit ff6d984d4c
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8
34 changed files with 119 additions and 278 deletions

View File

@ -2,7 +2,7 @@
* { * {
al: #00000000; al: #00000000;
bg: #000000ff; bg: #00000099;
se: #101010ff; se: #101010ff;
fg: #FFFFFFff; fg: #FFFFFFff;
ac: #FFFF00ff; ac: #FFFF00ff;

View File

@ -1,12 +0,0 @@
[Unit]
Description=Alarm Clock
Wants=taffybar.service
After=status-notifier-watcher.service
[Service]
Type=simple
ExecStart=/usr/bin/env alarm-clock-applet
ExecStop=/usr/bin/env pkill alarm-clock-applet
[Install]
WantedBy=wm.target

View File

@ -1,12 +0,0 @@
[Unit]
Description=chromix-too
Wants=taffybar.service
After=taffybar.service
[Service]
Type=simple
ExecStart=/usr/bin/env chromix-too-server
ExecStop=/usr/bin/env pkill chromix-too
[Install]
WantedBy=wm.target

View File

@ -1,12 +0,0 @@
[Unit]
Description=clipit
Wants=taffybar.service
After=taffybar.service
[Service]
Type=simple
ExecStart=/usr/bin/env clipit
ExecStop=/usr/bin/env pkill clipit
[Install]
WantedBy=wm.target

View File

@ -1,11 +0,0 @@
[Unit]
Description=discord
Wants=taffybar.service
After=taffybar.service
[Service]
ExecStart=/usr/bin/env run_unity.sh discord
Restart=always
[Install]
WantedBy=wm.target

View File

@ -1,12 +0,0 @@
[Unit]
Description=git-sync %f %I %i
[Service]
Type=simple
ExecStart=/usr/bin/env git_sync_directory.sh %f
ExecStop=/usr/bin/env pkill git_sync_directory.sh
Restart=always
RestartSec=3
[Install]
WantedBy=wm.target

View File

@ -1,12 +0,0 @@
[Unit]
Description=github-notifications
Wants=taffybar.service
After=taffybar.service
[Service]
Type=simple
ExecStart=/usr/bin/env notifications-tray-icon --github-token-pass github-token
ExecStop=/usr/bin/env pkill 'notifications-tray-icon --github-token-pass github-token'
[Install]
WantedBy=wm.target

View File

@ -1,11 +0,0 @@
[Unit]
Description=gitter
Wants=taffybar.service
After=taffybar.service
[Service]
ExecStart=/usr/bin/env Gitter
Restart=always
[Install]
WantedBy=wm.target

View File

@ -1,12 +0,0 @@
[Unit]
Description=KDE Connect
Wants=taffybar.service
After=taffybar.service
[Service]
Type=simple
ExecStart=/usr/bin/env kdeconnect-indicator
ExecStop=/usr/bin/env pkill kdeconnect-indicator
[Install]
WantedBy=wm.target

View File

@ -1,12 +0,0 @@
[Unit]
Description=lxqt-powermanagement
Wants=taffybar.service
After=taffybar.service
[Service]
Type=simple
ExecStart=/usr/bin/env lxqt-powermanagement
ExecStop=/usr/bin/env pkill lxqt-powermanagement
[Install]
WantedBy=wm.target

View File

@ -1,10 +0,0 @@
[Unit]
Description=mopidy
[Service]
Type=simple
ExecStart=/usr/bin/env mopidy
ExecStop=/usr/bin/env pkill mopidy
[Install]
WantedBy=wm.target

View File

@ -1,12 +0,0 @@
[Unit]
Description=NM Applet
Wants=taffybar.service
After=taffybar.service
[Service]
Type=simple
ExecStart=/usr/bin/env nm-applet --sm-disable --indicator
ExecStop=/usr/bin/env pkill nm-applet
[Install]
WantedBy=wm.target

View File

@ -1,10 +0,0 @@
[Unit]
Description=notify-osd
[Service]
Type=simple
ExecStart=/usr/bin/env notify-osd
ExecStop=/usr/bin/env pkill notify-osd
[Install]
WantedBy=wm.target

View File

@ -1,12 +0,0 @@
[Unit]
Description=Pulse Audio System Tray
Wants=taffybar.service
After=taffybar.service
[Service]
Type=simple
ExecStart=/usr/bin/env pasystray
ExecStop=/usr/bin/env pkill pasystray
[Install]
WantedBy=wm.target

View File

@ -1,10 +0,0 @@
[Unit]
Description=picom
[Service]
Type=simple
ExecStart=/usr/bin/env picom -cC
ExecStop=/usr/bin/env pkill picom
[Install]
WantedBy=wm.target

View File

@ -1,12 +0,0 @@
[Unit]
Description=skippy-xd
Wants=taffybar.service
After=taffybar.service
[Service]
Type=simple
ExecStart=/usr/bin/env skippy-xd --start-daemon
ExecStop=/usr/bin/env pkill skippy-xd
[Install]
WantedBy=wm.target

View File

@ -1,10 +0,0 @@
[Unit]
Description=status-notifier-watcher
[Service]
Type=simple
ExecStart=/usr/bin/env status-notifier-watcher
ExecStop=/usr/bin/env pkill status-notifier-watcher
[Install]
WantedBy=wm.target

View File

@ -1,15 +0,0 @@
[Unit]
Description=taffybar
Wants=status-notifier-watcher.service
After=status-notifier-watcher.service
[Service]
Type=notify
ExecStart=/usr/bin/env imalison-taffybar
ExecStop=/usr/bin/env pkill imalison-taffybar
Restart=always
RestartSec=3
NotifyAccess=all
[Install]
WantedBy=wm.target

View File

@ -1,11 +0,0 @@
[Unit]
Description=udiskie
Wants=taffybar.service
After=taffybar.service
[Service]
ExecStart=/usr/bin/env udiskie --tray --appindicator
Restart=always
[Install]
WantedBy=wm.target

View File

@ -1,10 +0,0 @@
[Unit]
Description=volnoti
[Service]
Type=simple
ExecStart=/usr/bin/env volnoti -n -v
ExecStop=/usr/bin/env pkill volnoti
[Install]
WantedBy=wm.target

View File

@ -1,9 +0,0 @@
[Unit]
Description=wallpaper
[Service]
Type=oneshot
ExecStart=/usr/bin/env wallpaper.sh
[Install]
WantedBy=wm.target

View File

@ -1,9 +0,0 @@
[Unit]
Description=Switch Wallpapers Every 15 minutes
[Timer]
OnUnitActiveSec=5min
OnBootSec=0min
[Install]
WantedBy=wm.target

View File

@ -1,3 +0,0 @@
[Unit]
Description=Window Manager
AllowIsolate=yes

View File

@ -1,9 +0,0 @@
[Unit]
Description=X Settings Daemon
[Service]
ExecStart=/usr/bin/env xsettingsd-setup
ExecStop=/usr/bin/env pkill xsettingsd
[Install]
WantedBy=wm.target

View File

@ -10,7 +10,7 @@ build-type: Simple
extra-source-files: README.org extra-source-files: README.org
cabal-version: >=1.10 cabal-version: >=1.10
executable imalison-taffybar executable taffybar
hs-source-dirs: . hs-source-dirs: .
main-is: taffybar.hs main-is: taffybar.hs
ghc-options: -threaded -rtsopts -with-rtsopts=-N ghc-options: -threaded -rtsopts -with-rtsopts=-N

View File

@ -145,7 +145,7 @@ main = do
(\size _ -> lift $ loadPixbufByName size "application-default-icon") (\size _ -> lift $ loadPixbufByName size "application-default-icon")
layout = layoutNew defaultLayoutConfig layout = layoutNew defaultLayoutConfig
windows = windowsNew defaultWindowsConfig windows = windowsNew defaultWindowsConfig
notifySystemD = void $ runCommandFromPath ["systemd-notify", "--ready"]
myWorkspacesConfig = myWorkspacesConfig =
defaultWorkspacesConfig defaultWorkspacesConfig
{ underlineHeight = 3 { underlineHeight = 3
@ -229,7 +229,6 @@ main = do
-- , startWidgets = [] -- , startWidgets = []
} }
startTaffybar $ startTaffybar $
appendHook notifySystemD $
appendHook (void $ getHost False) $ appendHook (void $ getHost False) $
withLogServer $ withLogServer $
withToggleServer $ withToggleServer $

View File

@ -1,10 +0,0 @@
#!/usr/bin/env bash
SRC_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
output_file=$1; shift
cd "$SRC_DIR"
exe_location="$SRC_DIR/result/bin/imalison-xmonad"
nix-build
cp -f "$exe_location" "$output_file"

View File

@ -34,6 +34,8 @@ import System.IO.Unsafe
import System.Process import System.Process
import Text.Printf import Text.Printf
import Unsafe.Coerce import Unsafe.Coerce
import XMonad.Main (launch)
import XMonad.Core (getDirectories)
import XMonad hiding ( (|||) ) import XMonad hiding ( (|||) )
import XMonad.Actions.CycleWS hiding (nextScreen) import XMonad.Actions.CycleWS hiding (nextScreen)
import XMonad.Actions.CycleWorkspaceByScreen import XMonad.Actions.CycleWorkspaceByScreen
@ -100,14 +102,10 @@ myConfig = def
myNavigation2DConfig = def { defaultTiledNavigation = centerNavigation } myNavigation2DConfig = def { defaultTiledNavigation = centerNavigation }
main = main = do
xmonad . dirs <- getDirectories
docks . (flip launch dirs) . docks . pagerHints . ewmh . withNavigation2DConfig myNavigation2DConfig $ myConfig
pagerHints .
ewmh .
withNavigation2DConfig myNavigation2DConfig $
myConfig
-- Utility functions -- Utility functions
-- Log to a file from anywhere -- Log to a file from anywhere

View File

@ -0,0 +1 @@
ROFI_SYSTEMD_TERM=alacritty

View File

@ -70,7 +70,7 @@ in
# Tools # Tools
binutils binutils
# direnv gawk
gitFull gitFull
htop htop
ncdu ncdu

View File

@ -19,6 +19,26 @@
"type": "github" "type": "github"
} }
}, },
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1626168714,
"narHash": "sha256-LivElv4aPfojh8HxJy6VAmDAf7zA40S7jGGSV7+wLvg=",
"owner": "IvanMalison",
"repo": "home-manager",
"rev": "557c159dfaf17eff3bd55ad6e8433bf59f40fab0",
"type": "github"
},
"original": {
"owner": "IvanMalison",
"repo": "home-manager",
"type": "github"
}
},
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1625333638, "lastModified": 1625333638,
@ -74,7 +94,7 @@
}, },
"nixpkgs_4": { "nixpkgs_4": {
"locked": { "locked": {
"narHash": "sha256-vAvfFQe4KHWheJHI4cEc2CYTzXnuRAvPu/bTH4GXhcc=", "narHash": "sha256-oHUlQvEu4A9dWu52bZdxg29z5Xy6NVJGZjmsKwb6yo4=",
"path": "/home/imalison/Projects/nixpkgs", "path": "/home/imalison/Projects/nixpkgs",
"type": "path" "type": "path"
}, },
@ -85,7 +105,7 @@
}, },
"nixpkgs_5": { "nixpkgs_5": {
"locked": { "locked": {
"narHash": "sha256-vAvfFQe4KHWheJHI4cEc2CYTzXnuRAvPu/bTH4GXhcc=", "narHash": "sha256-oHUlQvEu4A9dWu52bZdxg29z5Xy6NVJGZjmsKwb6yo4=",
"path": "/home/imalison/Projects/nixpkgs", "path": "/home/imalison/Projects/nixpkgs",
"type": "path" "type": "path"
}, },
@ -96,6 +116,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"taffybar": "taffybar", "taffybar": "taffybar",

View File

@ -13,11 +13,18 @@
url = path:../dotfiles/config/xmonad/xmonad; url = path:../dotfiles/config/xmonad/xmonad;
}; };
nixos-hardware.url = github:nixos/nixos-hardware; nixos-hardware.url = github:nixos/nixos-hardware;
home-manager = {
url = github:IvanMalison/home-manager;
inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = { self, nixpkgs, nixos-hardware, taffybar, xmonad, xmonad-contrib }: };
let tweaks = ({...}: { outputs = { self, nixpkgs, nixos-hardware, home-manager, taffybar, xmonad, xmonad-contrib }:
let forAll = ({...}: {
nix.registry.nixpkgs.flake = nixpkgs; nix.registry.nixpkgs.flake = nixpkgs;
nixpkgs.overlays = [ taffybar.overlay xmonad.overlay xmonad-contrib.overlay ]; nixpkgs.overlays = [ taffybar.overlay xmonad.overlay xmonad-contrib.overlay ];
imports = [
home-manager.nixosModule
];
}); });
piHardware = ({ ... }: { piHardware = ({ ... }: {
imports = [ imports = [
@ -29,15 +36,15 @@
nixosConfigurations = { nixosConfigurations = {
ivanm-dfinity-razer = nixpkgs.lib.nixosSystem { ivanm-dfinity-razer = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ tweaks ./machines/ivanm-dfinity-razer.nix ]; modules = [ forAll ./machines/ivanm-dfinity-razer.nix ];
}; };
ryzen-shine = nixpkgs.lib.nixosSystem { ryzen-shine = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ tweaks ./machines/ryzen-shine.nix ]; modules = [ forAll ./machines/ryzen-shine.nix ];
}; };
biskcomp = nixpkgs.lib.nixosSystem { biskcomp = nixpkgs.lib.nixosSystem {
system = "aarch64-linux"; system = "aarch64-linux";
modules = [ tweaks piHardware ./machines/biskcomp.nix ]; modules = [ forAll piHardware ./machines/biskcomp.nix ];
}; };
}; };
}; };

66
nixos/home-manager.nix Normal file
View File

@ -0,0 +1,66 @@
{ pkgs, ... }: {
home.sessionVariablesExtra = ''
ROFI_SYSTEMD_TERM="alacritty"
'';
xsession = {
preferStatusNotifierItems = true;
};
home.emptyActivationPath = false;
programs.home-manager.enable = true;
programs.ssh = {
forwardAgent = true;
};
# programs.zsh = {
# enable = true;
# };
services.gpg-agent = {
enable = true;
defaultCacheTtl = 8 * 60 * 60;
maxCacheTtl = 8 * 60 * 60;
enableSshSupport = true;
};
services.picom = {
enable = true;
};
services.blueman-applet = {
enable = true;
};
services.taffybar = {
enable = true;
package = pkgs.haskellPackages.imalison-taffybar;
};
# notifyosd
# skippyxd
# volnoti
services.kdeconnect = {
enable = true;
indicator = true;
};
services.network-manager-applet.enable = true;
services.udiskie = {
enable = true;
tray = "always";
};
services.status-notifier-watcher.enable = true;
services.random-background = {
enable = true;
display = "center";
interval = "1h";
imageDirectory = "%h/Pictures/wallpaper/use";
};
services.xsettingsd.enable = true;
}

View File

@ -24,6 +24,9 @@
imalison = userDefaults // { imalison = userDefaults // {
name = "imalison"; name = "imalison";
shell = pkgs.zsh; shell = pkgs.zsh;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICzGkqGJm+nrMvsrfuWOLVxXHvi0UL1ULJmyfzS9sKpy imalison@biskcomp.local"
];
}; };
kat = userDefaults // { kat = userDefaults // {
name = "kat"; name = "kat";
@ -31,5 +34,9 @@
}; };
}; };
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.imalison = import ./home-manager.nix;
nix.trustedUsers = ["imalison" "kat"]; nix.trustedUsers = ["imalison" "kat"];
} }