Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typos, format, linting #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 30 additions & 19 deletions Documentation/INSTALLING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<!-- actually `sh`, but github nushell syntax highlighting is better -->
```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
```
19 changes: 16 additions & 3 deletions Documentation/PARTITIONING.md
Original file line number Diff line number Diff line change
@@ -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`

<!-- actually `sh`, but github nushell syntax highlighting is better -->
```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
```
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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**
Expand All @@ -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:
```

<!--
actually `plaintext`, but github haskell syntax highlighting works well with source tree
`qml` syntax highlighting is also very good for this
-->
```hs
.
├── flake.nix
├── flake.lock
Expand All @@ -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
Expand All @@ -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!**
2 changes: 1 addition & 1 deletion dotfiles/nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion dotfiles/sway_config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dotfiles/tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion dotfiles/xmobar.hs
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
10 changes: 5 additions & 5 deletions dotfiles/xmonad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
Expand All @@ -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
-}
Expand All @@ -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 ()

Expand Down Expand Up @@ -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
Expand All @@ -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 ++ " ")))
}
Expand Down
2 changes: 1 addition & 1 deletion hardware/chromebook/disks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions hosts/luna/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions hosts/phobos/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down