From 1b80cf4d571d047931589e7677f764b9429706e8 Mon Sep 17 00:00:00 2001 From: Alexdelia Date: Wed, 31 Jul 2024 21:19:59 +0200 Subject: [PATCH 1/2] doc: typos, markdown format and markdown linting --- Documentation/INSTALLING.md | 49 +++++++++++++++++++++-------------- Documentation/PARTITIONING.md | 19 +++++++++++--- README.md | 17 +++++++++--- dotfiles/xmonad.hs | 2 +- 4 files changed, 60 insertions(+), 27 deletions(-) diff --git a/Documentation/INSTALLING.md b/Documentation/INSTALLING.md index ba64815..ced6c98 100644 --- a/Documentation/INSTALLING.md +++ b/Documentation/INSTALLING.md @@ -15,50 +15,61 @@ An example complete configuration could be: `phobos-laptop-x86_64-linux` [This i All these variables are declared in the `flake.nix` and can be added/removed to fit your needs. - # Installation Steps + Make sure you're in the `nixos-config` folder and have followed (if necessary) the [partitioning steps](PARTITIONING.md) :) -## NixOS-Based Intallation + +## NixOS-Based Installation + ### Installing -``` -$ nixos-install --flake .#$HOST-$HARDWARE-$ARCH + +```nushell +nixos-install --flake .#$HOST-$HARDWARE-$ARCH ``` ### Updating -``` -$ nix flake update +```nushell +nix flake update -$ nixos-rebuild switch --flake .#$HOST-$HARDWARE-$ARCH +nixos-rebuild switch --flake .#$HOST-$HARDWARE-$ARCH ``` ## Non-Nixos-Based Installation + ### Installing -``` -$ nix build .#homeManagerConfigurations.$HOST-$HARDWARE-$ARCH.activationPackage -$ ./result/activate + +```nushell +nix build .#homeManagerConfigurations.$HOST-$HARDWARE-$ARCH.activationPackage + +./result/activate ``` ### Updating -``` -$ nix flake update -$ home-manager switch --flake .#$HOST-$HARDWARE-$ARCH +```nushell +nix flake update + +home-manager switch --flake .#$HOST-$HARDWARE-$ARCH ``` ## ISO + ### Building -``` -$ nix build .#isoConfigurations.$HOST-$HARDWARE-$ARCH.config.system.build.isoImage + +```nushell +nix build .#isoConfigurations.$HOST-$HARDWARE-$ARCH.config.system.build.isoImage ``` ## Deploying -``` -# deploy -s .#$HOST-$HARDWARE-$ARCH --hostname $TARGET_IP + +```nushell +deploy -s .#$HOST-$HARDWARE-$ARCH --hostname $TARGET_IP ``` ## Testing -``` -$ nix eval .#tests + +```nushell +nix eval .#tests ``` diff --git a/Documentation/PARTITIONING.md b/Documentation/PARTITIONING.md index 09bc492..b4a3597 100644 --- a/Documentation/PARTITIONING.md +++ b/Documentation/PARTITIONING.md @@ -1,11 +1,24 @@ # Partitioning & Mounting + My NixOS configuration has some extra helpers for partitioning and mounting :) These scripts live in your specific `hardware/$HARDWARE/disks.nix` (Which should be customized to fit your specific configuration). ### Creating disks -`nix run .#nixosConfigurations.$HOST-$HARDWARE-$ARCH.config.disks-create` + + +```nushell +nix run .#nixosConfigurations.$HOST-$HARDWARE-$ARCH.config.disks-create +``` + ### Formatting disks -`nix run .#nixosConfigurations.$HOST-$HARDWARE-$ARCH.config.disks-format` + +```nushell +nix run .#nixosConfigurations.$HOST-$HARDWARE-$ARCH.config.disks-format +``` + ### Mounting disks -`nix run .#nixosConfigurations.$HOST-$HARDWARE-$ARCH.config.disks-mount` + +```nushell +nix run .#nixosConfigurations.$HOST-$HARDWARE-$ARCH.config.disks-mount +``` diff --git a/README.md b/README.md index 7d3c095..18ee3a2 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,15 @@ # NIX Config -My current (and everchanging) NixOS configuration Flake. +My current (and everchanging) NixOS configuration Flake. ![NixOS Configuration Image](./Documentation/desktop_screenshot.png) - + ## Installation + Installation steps are in [Documentation/INSTALLING.md](./Documentation/INSTALLING.md) ## Highlights + * Multiple NixOS configurations, including desktop, laptop, and VM * Install and partitioning scripts * **Impermanence** @@ -18,8 +20,14 @@ Installation steps are in [Documentation/INSTALLING.md](./Documentation/INSTALLI * Wayland (*sway*) and XOrg (*XMonad*) desktops ## Structure + Here is an overview of the repos' structure: -``` + + +```hs . ├── flake.nix ├── flake.lock @@ -45,6 +53,7 @@ Here is an overview of the repos' structure: ├── disks.nix └── hardware.nix ``` + * `modules`: encapsulated NixOS modules used in parts of the config * `overlays`: nixpkgs overlays used in the config * `packages`: extra packages used in the config @@ -53,4 +62,4 @@ Here is an overview of the repos' structure: * `hosts`: the host-specific config. Contains folders representing each host with their own specific config * `hardware`: the hardware-specific config (eg. Disks & Partitions). Contains folders representing each hardware -**This configuration was made to be modular and customizable; don't hesistate to adopt it and make it YOURS!** +**This configuration was made to be modular and customizable; don't hesitate to adopt it and make it YOURS!** diff --git a/dotfiles/xmonad.hs b/dotfiles/xmonad.hs index 1a823fb..fe17dec 100644 --- a/dotfiles/xmonad.hs +++ b/dotfiles/xmonad.hs @@ -125,7 +125,7 @@ urgentColor = "#ff0000" ------------------------------------------------------------------------ {- - This sets the "_NET_WM_STATE_FULLSCREEN" window property, helping some programs such as firefox to adjust acoordingly to fullscreen mode + This sets the "_NET_WM_STATE_FULLSCREEN" window property, helping some programs such as firefox to adjust accordingly to fullscreen mode In a perfect world we shouldnt need to do this manually but it seems like ewmhFullscreen/others dont implement this functionality -} setFullscreenProp :: Bool -> Window -> X () From 07bcda87d7cbd0808b3d6446220e462e8cc4dba7 Mon Sep 17 00:00:00 2001 From: Alexdelia Date: Wed, 31 Jul 2024 21:34:18 +0200 Subject: [PATCH 2/2] format: trailing whitespace --- dotfiles/nvim/init.lua | 2 +- dotfiles/sway_config | 2 +- dotfiles/tmux.conf | 2 +- dotfiles/xmobar.hs | 2 +- dotfiles/xmonad.hs | 8 ++++---- hardware/chromebook/disks.nix | 2 +- hosts/luna/home.nix | 4 ++-- hosts/phobos/home.nix | 4 ++-- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dotfiles/nvim/init.lua b/dotfiles/nvim/init.lua index 1eaeef9..d905bbb 100644 --- a/dotfiles/nvim/init.lua +++ b/dotfiles/nvim/init.lua @@ -238,7 +238,7 @@ require('lazy').setup({ {'echasnovski/mini.pairs', opts = {} }, 'github/copilot.vim', - + { 'klen/nvim-test', config = function() require('nvim-test.runners.go-test'):setup { diff --git a/dotfiles/sway_config b/dotfiles/sway_config index cc596a6..85688aa 100644 --- a/dotfiles/sway_config +++ b/dotfiles/sway_config @@ -104,7 +104,7 @@ exec "swaybg -i /home/baitinq/Images/Wallpapers/Day/wave.jpg &" # Change normal to inverse to use left mouse button for resizing and right # mouse button for dragging. floating_modifier $mod normal - + focus_follows_mouse no mouse_warping none exec wl-paste -t text --watch clipman store --no-persist diff --git a/dotfiles/tmux.conf b/dotfiles/tmux.conf index 6662ba4..1b2f05a 100644 --- a/dotfiles/tmux.conf +++ b/dotfiles/tmux.conf @@ -12,7 +12,7 @@ bind C-Space send-prefix # Vim style pane selection bind h select-pane -L -bind j select-pane -D +bind j select-pane -D bind k select-pane -U bind l select-pane -R diff --git a/dotfiles/xmobar.hs b/dotfiles/xmobar.hs index fe9e66b..c3096ed 100644 --- a/dotfiles/xmobar.hs +++ b/dotfiles/xmobar.hs @@ -1,4 +1,4 @@ -Config { +Config { -- appearance font = "xft:Noto Sans Display Nerd Font:size=10,Inconsolata LGC Nerd Font:size=10,DejaVu Sans Mono Nerd Font:size=10,Noto Sans Mono CJK JP:size=10,Noto Color Emoji:size=10,Noto Sans Hebrew:size=10" diff --git a/dotfiles/xmonad.hs b/dotfiles/xmonad.hs index fe17dec..ec03f17 100644 --- a/dotfiles/xmonad.hs +++ b/dotfiles/xmonad.hs @@ -136,7 +136,7 @@ setFullscreenProp b win = withDisplay $ \dpy -> do if b then io $ replaceWMStateProperty [fromIntegral fullsc] else io $ replaceWMStateProperty [] -{- +{- Fullscreen: Hide xmobar -> Hide borders -> Set fullscreen -> Set fullscreenprops Unfullscreen: ^^ but reverse -} @@ -145,7 +145,7 @@ toggleFullScreen = do mIsFullScreen <- withWindowSet (isToggleActive NBFULL . W.workspace . W.current) case mIsFullScreen of Just isFullScreen -> if isFullScreen - then withFocused (setFullscreenProp False) >> sendMessage (Toggle NBFULL) >> sendMessage ToggleStruts + then withFocused (setFullscreenProp False) >> sendMessage (Toggle NBFULL) >> sendMessage ToggleStruts else sendMessage ToggleStruts >> sendMessage (Toggle NBFULL) >> withFocused (setFullscreenProp True) Nothing -> return () @@ -232,7 +232,7 @@ myMouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $ 3. Set a 2 space separation between workspaces. -} myStatusBar :: StatusBarConfig -myStatusBar = statusBarProp "xmobar" (do +myStatusBar = statusBarProp "xmobar" (do numWindows <- getNumberOfWindowsInWorkpace return $ def { ppCurrent = if numWindows > 0 @@ -242,7 +242,7 @@ myStatusBar = statusBarProp "xmobar" (do , ppSep = " | " , ppWsSep = "" , ppLayout = (\_ -> "") - , ppHidden = (\s -> clickableWrap ((read s::Int) - 1) (createDwmBox foregroundColor (" " ++ s ++ " "))) --better way to clickablewrap . + , ppHidden = (\s -> clickableWrap ((read s::Int) - 1) (createDwmBox foregroundColor (" " ++ s ++ " "))) --better way to clickablewrap . , ppHiddenNoWindows = (\s -> clickableWrap ((read s::Int) - 1) (" " ++ s ++ " ")) , ppUrgent = (\s -> clickableWrap ((read s::Int) - 1) (xmobarBorder "Top" urgentColor 4 (" " ++ s ++ " "))) } diff --git a/hardware/chromebook/disks.nix b/hardware/chromebook/disks.nix index c191b25..2e2c90f 100644 --- a/hardware/chromebook/disks.nix +++ b/hardware/chromebook/disks.nix @@ -40,7 +40,7 @@ let partitionsMountScript = '' mount -t tmpfs none /mnt mkdir -p /mnt/{boot,nix,persist,home} - + cryptsetup open --type luks /dev/disk/by-partlabel/boot encrypted_boot mount /dev/mapper/encrypted_boot /mnt/boot mkdir -p /mnt/boot/efi diff --git a/hosts/luna/home.nix b/hosts/luna/home.nix index 1169b3c..ec19f97 100644 --- a/hosts/luna/home.nix +++ b/hosts/luna/home.nix @@ -41,9 +41,9 @@ builtins.readFile "${dotfiles}/sxhkd/xmonad" + builtins.readFile "${dotfiles}/sxhkd/base" + '' - + #enter and leave game mode - alt + shift + F11: ctrl + shift + F11 + alt + shift + F11: ctrl + shift + F11 pkill -ALRM sxhkd # Make sxhkd reload its configuration files diff --git a/hosts/phobos/home.nix b/hosts/phobos/home.nix index 9babff9..b6e9b47 100644 --- a/hosts/phobos/home.nix +++ b/hosts/phobos/home.nix @@ -43,10 +43,10 @@ builtins.readFile "${dotfiles}/sxhkd/xmonad" + builtins.readFile "${dotfiles}/sxhkd/base" + '' - + # Not supported by swhkd #enter and leave game mode - #alt + shift + F11: ctrl + shift + F11 + #alt + shift + F11: ctrl + shift + F11 # pkill -ALRM sxhkd # Make sxhkd reload its configuration files