mirror of
https://github.com/zoriya/flake.git
synced 2025-12-06 06:36:19 +00:00
Add a taskfile
This commit is contained in:
14
README.md
14
README.md
@@ -20,9 +20,15 @@
|
|||||||
- A `.luarc.json` can be generated using `nix develop`
|
- A `.luarc.json` can be generated using `nix develop`
|
||||||
- The config can be used from anywhere using `nix run github:zoriya/flake#nvim`
|
- The config can be used from anywhere using `nix run github:zoriya/flake#nvim`
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
## Notes for myself
|
Format disk with:
|
||||||
|
- 200M efi part -> `mkfs.fat -F 32 -n boot /dev/sda1`
|
||||||
|
- other as linux part (/nix) -> `mkfs.ext4 -n nix /dev/sda2`
|
||||||
|
|
||||||
`mkdir -p /nix/persist/home` (else persisted seems to be bugged)
|
```sh
|
||||||
`nix-shell --run 'mkpasswd -p mkpasswd -m SHA-512 | tr -d \\n'` to generate a password
|
nix-shell -p git go-task
|
||||||
`NIX_CONFIG="extra-access-tokens = github.com=$(gh auth token)" nix flake update`
|
git clone https://github.com/zoriya/flake
|
||||||
|
cd flake
|
||||||
|
sudo task install
|
||||||
|
```
|
||||||
|
|||||||
@@ -158,7 +158,10 @@
|
|||||||
overlays = [nvim-overlay];
|
overlays = [nvim-overlay];
|
||||||
};
|
};
|
||||||
in rec {
|
in rec {
|
||||||
default = nvim-lua;
|
default = pkgs.mkShell {
|
||||||
|
inputsFrom = [nvim-lua];
|
||||||
|
packages = with pkgs; [go-task];
|
||||||
|
};
|
||||||
nvim-lua = pkgs.mkShell {
|
nvim-lua = pkgs.mkShell {
|
||||||
name = "nvim-lua";
|
name = "nvim-lua";
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
|
|||||||
49
taskfile.yaml
Normal file
49
taskfile.yaml
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
switch:
|
||||||
|
desc: switch to new version
|
||||||
|
cmds:
|
||||||
|
- cmd: nixos-rebuild switch --flake path:. --show-trace
|
||||||
|
platforms: [linux]
|
||||||
|
- cmd: darwin-rebuild switch --flake path:. --show-trace
|
||||||
|
platforms: [darwin]
|
||||||
|
|
||||||
|
update:
|
||||||
|
desc: update all deps
|
||||||
|
cmds:
|
||||||
|
- nix flake update
|
||||||
|
env:
|
||||||
|
NIX_CONFIG:
|
||||||
|
sh: echo "extra-access-tokens = github.com=$(gh auth token)"
|
||||||
|
|
||||||
|
# Install stuff
|
||||||
|
|
||||||
|
install:
|
||||||
|
desc: install to disks labeled `nix` and `boot`
|
||||||
|
deps: [password:root, password:zoriya]
|
||||||
|
cmds:
|
||||||
|
- mount /dev/disk/by-label/boot /mnt/boot
|
||||||
|
- mount /dev/disk/by-label/nix /mnt/nix
|
||||||
|
- task: swap
|
||||||
|
- defer: { task: swap-off }
|
||||||
|
- nixos-install --no-channel-copy --no-root-password
|
||||||
|
|
||||||
|
password:*:
|
||||||
|
desc: setup passwords
|
||||||
|
vars:
|
||||||
|
USER: "{{index .MATCH 0}}"
|
||||||
|
cmds:
|
||||||
|
- nix-shell -p mkpasswd --run 'mkpasswd -m SHA-512 | tr -d \\n > password/{{.USER}}'
|
||||||
|
status:
|
||||||
|
- test -f password/{{.USER}}
|
||||||
|
|
||||||
|
swap:
|
||||||
|
desc: setup swap file (for live usb mostly)
|
||||||
|
cmds:
|
||||||
|
- mkswap -U clear --size 20G --file /mnt/nix/swap
|
||||||
|
- swapon /mnt/nix/swap
|
||||||
|
swap-off:
|
||||||
|
cmds:
|
||||||
|
- swapoff /mnt/nix/swap
|
||||||
|
- rm /mnt/nix/swap
|
||||||
Reference in New Issue
Block a user