90 Commits

Author SHA1 Message Date
andromeda
580cbd1851 init nix-on-droid 2026-01-14 22:57:40 +01:00
andromeda
6fdcd13627 adjust brightness, disable touchpad sometimes 2026-01-14 20:18:25 +01:00
andromeda
6fb816f27c reenable ipv6; reconfigure browser 2026-01-14 05:31:48 +01:00
andromeda
c0e92a4ef3 typo 2026-01-13 10:55:24 +01:00
andromeda
b754a3d53f matrix-synapse? 2026-01-13 10:48:56 +01:00
andromeda
19d45ebd05 edit TODO.md 2026-01-13 06:29:18 +01:00
andromeda
312ee02d9e fix alias traversal 2026-01-13 06:21:08 +01:00
andromeda
c377598d5c conduit setup? 2026-01-13 06:16:27 +01:00
andromeda
dcb82ed361 add README, conduit 2026-01-13 05:53:57 +01:00
andromeda
b25ce469b6 persist zulip 2026-01-12 19:09:27 +01:00
andromeda
d2d370442b ssl port email? 2026-01-12 18:01:52 +01:00
andromeda
e05c9fe5a5 add tls (I don't know how this works) 2026-01-12 17:46:49 +01:00
andromeda
c1d8b4dff3 use non-tls ssl? [fix typo] 2026-01-12 17:37:55 +01:00
andromeda
a7e65a0943 use non-tls ssl? 2026-01-12 17:35:38 +01:00
andromeda
d2e95f2fb8 add EMAIL_HOST_USER? 2026-01-12 16:31:58 +01:00
andromeda
9b0944223f fix typo 2026-01-12 16:19:37 +01:00
andromeda
bea6414758 actually add zulip module 2026-01-12 15:45:38 +01:00
andromeda
90ad40e207 fix zulip? 2026-01-12 15:41:06 +01:00
andromeda
803bc95317 fix dkim perms? 2026-01-12 14:26:35 +01:00
andromeda
4bd6ddece1 declare dkim secrets 2026-01-12 13:30:25 +01:00
andromeda
3fa9a368bf update remote pub keys 2026-01-12 13:04:33 +01:00
andromeda
103ec86fc2 persist /etc/ssh 2026-01-12 13:03:02 +01:00
andromeda
d9a6791fa3 ready for new deployment 2026-01-12 12:55:20 +01:00
andromeda
70445c1c8c update ff search 2026-01-12 12:53:33 +01:00
andromeda
47aa29ba33 finally fix ipv6? 2026-01-12 10:06:28 +01:00
andromeda
0970f7d0ee fix finally? 2026-01-12 09:54:54 +01:00
andromeda
e5746332bb persist vpn conf 2026-01-12 09:49:13 +01:00
andromeda
e38e0b95dc disable ipv6 2026-01-12 09:36:48 +01:00
andromeda
e6669a9d88 add openvpn 2026-01-12 09:34:25 +01:00
andromeda
de911e358b disable forgejo as broken 2026-01-10 21:48:57 +01:00
andromeda
b76f6ba3d6 rekey 2026-01-10 20:51:27 +01:00
andromeda
45f5249165 fix ssh 2026-01-10 15:30:17 +01:00
andromeda
90dd0582b0 forgejo 2026-01-10 15:23:02 +01:00
andromeda
0781c8428d fix agenix boot problem on remote? 2026-01-10 10:33:06 +01:00
andromeda
2d1048b00f add roundcube persist 2026-01-10 10:21:04 +01:00
andromeda
58f011079c rekey 2026-01-10 10:08:40 +01:00
andromeda
d32f99baf5 persist acme, update public key 2026-01-10 10:07:01 +01:00
andromeda
13141933b4 enable roundcube, backup mailserver 2026-01-10 10:01:38 +01:00
andromeda
a57edbf3fd enable mailserver 2026-01-10 09:48:42 +01:00
andromeda
bf22a9de21 add /etc/ssh persist to remote 2026-01-10 09:02:24 +01:00
andromeda
411ee0c027 add remote disko and some other things 2026-01-10 08:59:54 +01:00
andromeda
aec328ce93 glide-browser, fix typo 2026-01-10 01:58:07 +01:00
andromeda
7cbd450c61 remove services 2026-01-10 00:57:41 +01:00
andromeda
97fca4cc7e fix up remote 109-199-104-83 2026-01-10 00:55:44 +01:00
andromeda
243d7f3fc3 fix a couple mistakes 2026-01-10 00:32:55 +01:00
andromeda
3f1b2d8789 disable sudo lecture 2026-01-09 23:38:21 +01:00
andromeda
0658c5d898 modularise lenovo? 2026-01-09 23:23:07 +01:00
andromeda
8b79f4e825 add new settings 2026-01-06 22:29:05 +01:00
andromeda
7fa3c698ed fix email password zulip 2026-01-06 22:22:28 +01:00
andromeda
d3b6e8ed47 add email password zulip 2026-01-06 22:16:24 +01:00
andromeda
55a87d3d02 open 2026-01-06 21:50:17 +01:00
andromeda
4c9b42ecc7 remove goofy zulip acc 2026-01-06 21:25:34 +01:00
andromeda
446ff7b960 add mail alias 2026-01-06 21:15:20 +01:00
andromeda
0f2367c4b5 change zulip+admin password 2026-01-06 21:05:25 +01:00
andromeda
b174863576 use local postgresql for zulip 2026-01-06 20:46:21 +01:00
andromeda
cf25c67849 unify hosts 2026-01-06 20:35:46 +01:00
andromeda
5424bfc493 fix stupid mistake 2026-01-06 20:22:46 +01:00
andromeda
1412004174 add pub ssh key to remote xD 2026-01-06 20:15:04 +01:00
andromeda
beaceffff0 init 2026-01-06 18:30:12 +01:00
andromeda
c9a5c521db stash 2026-01-06 14:52:34 +01:00
andromeda
0a7e0c699e merge secrets from development 2026-01-05 15:07:41 +01:00
andromeda
0e93982125 merge new secrets 2026-01-05 15:06:43 +01:00
andromeda
2114c6c347 rename secrets 2026-01-05 14:35:42 +01:00
andromeda
b0da60cdab evaluates 2026-01-05 13:48:06 +01:00
andromeda
0fee255cbf add mailserver to devline 2026-01-02 22:22:06 +01:00
andromeda
3fc40529c8 remove user on server 2026-01-02 22:14:04 +01:00
andromeda
2ed0cade4d use mkpasswd -s rather than mkpasswd? 2026-01-02 21:06:04 +01:00
andromeda
1d17664e7a reset mail password 2026-01-02 20:48:50 +01:00
andromeda
c632cd20c6 roundcube? 2026-01-02 20:33:21 +01:00
andromeda
5366c48991 use nginx for acme 2026-01-02 20:21:46 +01:00
andromeda
6db05df6a7 add firewall xD 2026-01-02 18:37:27 +01:00
andromeda
52a906919d change cert email to a real email :'( 2026-01-02 18:24:00 +01:00
andromeda
e665bb0b14 attempt mailserver? 2026-01-02 18:05:01 +01:00
andromeda
33814b565d add tridactyl to ff 2026-01-02 01:10:56 +01:00
andromeda
b86b5eae5e add global module for phoenix 2026-01-02 01:06:12 +01:00
andromeda
834472fe38 replace librewolf with stock ff 2026-01-02 00:47:58 +01:00
andromeda
122a7fa174 mb? 2026-01-01 20:21:14 +01:00
andromeda
49ba1149d8 mb? 2026-01-01 18:24:24 +01:00
andromeda
e8abf3ab16 reconfig ssh a bit? 2026-01-01 07:55:05 +01:00
andromeda
8ad0603114 remove useless lines 2026-01-01 07:23:03 +01:00
andromeda
7f4bac8208 new box 2026-01-01 07:20:43 +01:00
andromeda
92c4e1f7cf put user-level impermanence settings in users.nix 2025-12-31 14:04:44 +01:00
andromeda
51d9476042 fix ly complaint, move sway_config to its own file 2025-12-31 11:24:41 +01:00
andromeda
4b8882d82d change pub key management again, centralize users, start to modularize lenovo conf 2025-12-31 02:28:00 +01:00
andromeda
42a93f042e better machine conf, rework key/machines management 2025-12-31 01:14:37 +01:00
andromeda
07655e5135 add secret scheme 2025-12-30 19:47:50 +01:00
andromeda
89dfb0adb9 add README.md 2025-12-30 12:28:31 +01:00
andromeda
424e2015ae bug fixes 2025-12-30 11:34:27 +01:00
andromeda
8daeb01ea9 merge development onto master 2025-12-30 01:22:24 +01:00
andromeda
1463a81e8c modularise, combine 2025-12-30 00:32:23 +01:00
62 changed files with 1593 additions and 445 deletions

125
README.md Normal file
View File

@@ -0,0 +1,125 @@
see TODO.md for my aspirations
## usage
### install
note: I have not tested the following verbatim.
It *will* erase the contents of /dev/sdX. Use with caution.
1. create usb with minimal NixOS iso
2. boot from usb
3. create partitions
```console
$ #modern partition table
$ #WARNING all data on /dev/sdX will be erased. Make sure it is your target
$ parted /dev/sdX -- mklabel gpt
$ #make root partition
$ parted /dev/sdX -- mkpart ESP fat32 1MiB 512MiB
$ parted /dev/sdX -- set 1 esp on
$ #create store partition
$ parted /dev/sdX -- mkpart nix btrfs 512MiB 100GiB
$ #if your device is in english, use a period rather than a comma
$ parted /dev/sdX -- mkpart root btrfs 100GiB 199,5GiB
```
4. create filesystems
```console
$ #make sure not to get your subvolumes mixed up
$ #there should be 3, the first boot and the others 99,5GiB each
$ fdisk -l
$ #boot partition
$ mkfs.fat -F 32 /dev/sdX1
$ #store partition
$ mkfs.btrfs /dev/sdX2
$ #root partition
$ mkfs.btrfs /dev/sdX3
$ #create root subvolume
$ btrfs subvolume create /dev/sdX3/root
```
5. mount filesystems
```console
$ #note the uuid of your disks
$ #they will be symlinked to something recognisable
$ #don't get them mixed up
$ ls -l /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 15 Dez 30 11:31 0e586651-36f4-42b0-99b3-3f0704a894d6 -> ../../sdX2
lrwxrwxrwx 1 root root 15 Dez 30 11:31 16c93673-4f0e-4010-a7f4-7ccffb20edb7 -> ../../sdX3
lrwxrwxrwx 1 root root 15 Dez 30 11:31 F425-55BA -> ../../sdX1
$ #now mount the appropriate filesystems using your uuids; these are mine
$ mount -o subvol-root /dev/disk/by-uuid/16c93673-4f0e-4010-a7f4-7ccffb20edb7 /mnt
$ mkdir -p /mnt/{boot,nix}
$ mount -o umask=077 /dev/disk/by-uuid/F425-55BA /mnt/boot
$ mount /dev/disk/by-uuid/0e586651-36f4-42b0-99b3-3f0704a894d6 /mnt/nix
```
6. prepare for installation
```console
$ mkdir -p /mnt/etc/nixos
$ nixos-generate-config --root /mnt
$ cat /mnt/etc/nixos/hardware-configuration.nix
$ #note the random flags and stuff in hardware-configuration.nix; you might
$ #want to keep a copy around for the time being
$ rm /mnt/etc/nixos/*
$ #connect to the internet
$ nmtui
$ git clone https://git.mtgmonkey.net/andromeda/conf /mnt/etc/nixos
$ cd /mnt/etc/nixos
$ nix-shell -p tree --command tree
.
├── configuration.nix
├── flake.lock
├── flake.nix
├── machines
│   └── laptop
│   ├── hardware-configuration.nix
│   └── machine.nix
├── README.md
└── users
└── andromeda
├── home.nix
└── stylix.nix
5 directories, 8 files
$ #copy the `laptop` derivation and change all occurences of `laptop` with
$ #`your-machine` in `flake.nix`
$ cp machines/laptop machines/your-machine -r
$ #modify `machines/your-machine/hardware-configuration.nix` by changing the
$ #uuids to those of your drives
$ #also copy the flags and stuff from `hardware-configuration.nix` generated
$ #earlier
$ #change the hostname in `machines/your-machine/machine.nix` to your liking.
$ #If you want to pull request to my repo, `hostname` *must* be "your-machine"
$ #if you want a different user, edit `machines/your-machine/machine.nix` to
$ #reflect that. Create the file `users/your-user/home.nix` with your home
$ #manager configuration. Add your user's `impermanence` information in
$ #`configuration.nix`
$ #make sure to give your user an initalPassword, otherwise you won't be able
$ #to log in! Later, use a secrets scheme to have a real password
$ git add -A
```
7. install
```console
$ cd /mnt/etc/nixos
$ nix flake check
$ #resolve any errors. You may have forgotten to add things to git, users,
$ #machines...
$ nixos-install --no-root-password --flake .#your-machine
```
8. reboot
```console
$ systemctl reboot
```

20
TODO.md Normal file
View File

@@ -0,0 +1,20 @@
- add other remote
- fully automate remote provisioning (remote keys)
- fix ipv6 on remotes
- modularize home manager
- add services?
- 0x0
- forgejo
- matrix homeserver
- matrix webclient
- radicale
- tor relay
- wireguard as vpn
- add home functionality
- better term emulator
- switch browser?
- chromium: much better sandboxing
- ladybird: be an early tester, contribute
- glide: sexier tridactyl implementation
- browsh: the GOAT
- get mouse out of here

5
deploy.sh Executable file
View File

@@ -0,0 +1,5 @@
# usage:
# $ ./deploy.sh <hostname> <ip>
# example usage:
# $ ./deply.sh 109-199-104-83 109.199.104.83
nix run github:nix-community/nixos-anywhere -- --generate-hardware-config nixos-generate-config ./hardware-configuration.nix --flake .?ref=411ee0c#$1 --target-host root@$2

325
flake.lock generated
View File

@@ -91,6 +91,22 @@
"type": "github" "type": "github"
} }
}, },
"blobs": {
"flake": false,
"locked": {
"lastModified": 1604995301,
"narHash": "sha256-wcLzgLec6SGJA8fx1OEN1yV/Py5b+U5iyYpksUY/yLw=",
"owner": "simple-nixos-mailserver",
"repo": "blobs",
"rev": "2cccdf1ca48316f2cfd1c9a0017e8de5a7156265",
"type": "gitlab"
},
"original": {
"owner": "simple-nixos-mailserver",
"repo": "blobs",
"type": "gitlab"
}
},
"darwin": { "darwin": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -113,6 +129,27 @@
"type": "github" "type": "github"
} }
}, },
"disko": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1746728054,
"narHash": "sha256-eDoSOhxGEm2PykZFa/x9QG5eTH0MJdiJ9aR00VAofXE=",
"owner": "nix-community",
"repo": "disko",
"rev": "ff442f5d1425feb86344c028298548024f21256d",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "latest",
"repo": "disko",
"type": "github"
}
},
"firefox-gnome-theme": { "firefox-gnome-theme": {
"flake": false, "flake": false,
"locked": { "locked": {
@@ -130,6 +167,22 @@
} }
}, },
"flake-compat": { "flake-compat": {
"flake": false,
"locked": {
"lastModified": 1761588595,
"narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1751685974, "lastModified": 1751685974,
@@ -224,6 +277,54 @@
"type": "github" "type": "github"
} }
}, },
"git-hooks": {
"inputs": {
"flake-compat": [
"nixos-mailserver",
"flake-compat"
],
"gitignore": "gitignore",
"nixpkgs": [
"nixos-mailserver",
"nixpkgs"
]
},
"locked": {
"lastModified": 1763988335,
"narHash": "sha256-QlcnByMc8KBjpU37rbq5iP7Cp97HvjRP0ucfdh+M4Qc=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "50b9238891e388c9fdc6a5c49e49c42533a1b5ce",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"nixos-mailserver",
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"gnome-shell": { "gnome-shell": {
"flake": false, "flake": false,
"locked": { "locked": {
@@ -284,6 +385,27 @@
"type": "github" "type": "github"
} }
}, },
"home-manager_3": {
"inputs": {
"nixpkgs": [
"nix-on-droid",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709445365,
"narHash": "sha256-DVv6nd9FQBbMWbOmhq0KVqmlc3y3FMSYl49UXmMcO+0=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "4de84265d7ec7634a69ba75028696d74de9a44a7",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"impermanence": { "impermanence": {
"locked": { "locked": {
"lastModified": 1737831083, "lastModified": 1737831083,
@@ -332,6 +454,96 @@
"type": "github" "type": "github"
} }
}, },
"nix-formatter-pack": {
"inputs": {
"nixpkgs": [
"nix-on-droid",
"nixpkgs"
],
"nmd": [
"nix-on-droid",
"nmd"
],
"nmt": "nmt"
},
"locked": {
"lastModified": 1705252799,
"narHash": "sha256-HgSTREh7VoXjGgNDwKQUYcYo13rPkltW7IitHrTPA5c=",
"owner": "Gerschtli",
"repo": "nix-formatter-pack",
"rev": "2de39dedd79aab14c01b9e2934842051a160ffa5",
"type": "github"
},
"original": {
"owner": "Gerschtli",
"repo": "nix-formatter-pack",
"type": "github"
}
},
"nix-on-droid": {
"inputs": {
"home-manager": "home-manager_3",
"nix-formatter-pack": "nix-formatter-pack",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-docs": "nixpkgs-docs",
"nixpkgs-for-bootstrap": "nixpkgs-for-bootstrap",
"nmd": "nmd"
},
"locked": {
"lastModified": 1765031149,
"narHash": "sha256-4ZtlnCp4blhsjGnQIxAXDAj7nCJKy7tozoBRtklmwcU=",
"owner": "nix-community",
"repo": "nix-on-droid",
"rev": "55b6449b4582a4ba3ce712543c973360a026db7d",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-on-droid",
"type": "github"
}
},
"nix-zulip": {
"flake": false,
"locked": {
"lastModified": 1764583012,
"narHash": "sha256-6ht4dtI1TBDAaB/Tatq+FcPexaZTBWuRiJGnioCDx5c=",
"ref": "refs/heads/main",
"rev": "a9dd0f80d775745f1d88055f24d944562db97c5e",
"revCount": 67,
"type": "git",
"url": "https://git.afnix.fr/nix-zulip/nix-zulip"
},
"original": {
"type": "git",
"url": "https://git.afnix.fr/nix-zulip/nix-zulip"
}
},
"nixos-mailserver": {
"inputs": {
"blobs": "blobs",
"flake-compat": "flake-compat",
"git-hooks": "git-hooks",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1766321686,
"narHash": "sha256-icOWbnD977HXhveirqA10zoqvErczVs3NKx8Bj+ikHY=",
"owner": "simple-nixos-mailserver",
"repo": "nixos-mailserver",
"rev": "7d433bf89882f61621f95082e90a4ab91eb0bdd3",
"type": "gitlab"
},
"original": {
"owner": "simple-nixos-mailserver",
"repo": "nixos-mailserver",
"type": "gitlab"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1766651565, "lastModified": 1766651565,
@@ -348,6 +560,38 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-docs": {
"locked": {
"lastModified": 1705957679,
"narHash": "sha256-Q8LJaVZGJ9wo33wBafvZSzapYsjOaNjP/pOnSiKVGHY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9a333eaa80901efe01df07eade2c16d183761fa3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-for-bootstrap": {
"locked": {
"lastModified": 1720244366,
"narHash": "sha256-WrDV0FPMVd2Sq9hkR5LNHudS3OSMmUrs90JUTN+MXpA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "49ee0e94463abada1de470c9c07bfc12b36dcf40",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "49ee0e94463abada1de470c9c07bfc12b36dcf40",
"type": "github"
}
},
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1764242076, "lastModified": 1764242076,
@@ -364,6 +608,44 @@
"type": "github" "type": "github"
} }
}, },
"nmd": {
"inputs": {
"nixpkgs": [
"nix-on-droid",
"nixpkgs-docs"
],
"scss-reset": "scss-reset"
},
"locked": {
"lastModified": 1705050560,
"narHash": "sha256-x3zzcdvhJpodsmdjqB4t5mkVW22V3wqHLOun0KRBzUI=",
"owner": "~rycee",
"repo": "nmd",
"rev": "66d9334933119c36f91a78d565c152a4fdc8d3d3",
"type": "sourcehut"
},
"original": {
"owner": "~rycee",
"repo": "nmd",
"type": "sourcehut"
}
},
"nmt": {
"flake": false,
"locked": {
"lastModified": 1648075362,
"narHash": "sha256-u36WgzoA84dMVsGXzml4wZ5ckGgfnvS0ryzo/3zn/Pc=",
"owner": "rycee",
"repo": "nmt",
"rev": "d83601002c99b78c89ea80e5e6ba21addcfe12ae",
"type": "gitlab"
},
"original": {
"owner": "rycee",
"repo": "nmt",
"type": "gitlab"
}
},
"noshell": { "noshell": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -432,7 +714,7 @@
}, },
"nvf": { "nvf": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat_2",
"flake-parts": "flake-parts_2", "flake-parts": "flake-parts_2",
"mnw": "mnw", "mnw": "mnw",
"ndg": "ndg", "ndg": "ndg",
@@ -455,18 +737,59 @@
"type": "github" "type": "github"
} }
}, },
"phoenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1766543224,
"narHash": "sha256-96PBoNqh3sPU9t+IXxcB1OjjuQ8HOv42OOh9UtwFHbU=",
"owner": "celenityy",
"repo": "Phoenix",
"rev": "f09568c8a71af4fe42dd43c6f711c67daf605f1e",
"type": "github"
},
"original": {
"owner": "celenityy",
"repo": "Phoenix",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
"disko": "disko",
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
"impermanence": "impermanence", "impermanence": "impermanence",
"nix-on-droid": "nix-on-droid",
"nix-zulip": "nix-zulip",
"nixos-mailserver": "nixos-mailserver",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"noshell": "noshell", "noshell": "noshell",
"nur": "nur", "nur": "nur",
"nvf": "nvf", "nvf": "nvf",
"phoenix": "phoenix",
"stylix": "stylix" "stylix": "stylix"
} }
}, },
"scss-reset": {
"flake": false,
"locked": {
"lastModified": 1631450058,
"narHash": "sha256-muDlZJPtXDIGevSEWkicPP0HQ6VtucbkMNygpGlBEUM=",
"owner": "andreymatin",
"repo": "scss-reset",
"rev": "0cf50e27a4e95e9bb5b1715eedf9c54dee1a5a91",
"type": "github"
},
"original": {
"owner": "andreymatin",
"repo": "scss-reset",
"type": "github"
}
},
"stylix": { "stylix": {
"inputs": { "inputs": {
"base16": "base16", "base16": "base16",

View File

@@ -4,12 +4,28 @@
url = "github:ryantm/agenix"; url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
disko = {
url = "github:nix-community/disko/latest";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
impermanence.url = "github:nix-community/impermanence"; impermanence.url = "github:nix-community/impermanence";
nixos-mailserver = {
url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nix-on-droid = {
url = "github:nix-community/nix-on-droid";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-zulip = {
url = "git+https://git.afnix.fr/nix-zulip/nix-zulip";
flake = false;
};
noshell = { noshell = {
url = "github:viperML/noshell"; url = "github:viperML/noshell";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@@ -22,6 +38,10 @@
url = "github:notashelf/nvf"; url = "github:notashelf/nvf";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
phoenix = {
url = "github:celenityy/Phoenix";
inputs.nixpkgs.follows = "nixpkgs";
};
stylix = { stylix = {
url = "github:nix-community/stylix"; url = "github:nix-community/stylix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@@ -29,17 +49,22 @@
}; };
outputs = { outputs = {
agenix, agenix,
disko,
home-manager, home-manager,
impermanence, impermanence,
nixos-mailserver,
nixpkgs, nixpkgs,
nix-on-droid,
nix-zulip,
noshell, noshell,
nur, nur,
nvf, nvf,
phoenix,
stylix, stylix,
... ...
}: let }: let
laptop = import ./machines/laptop/machine.nix; nix-zulip' = (import "${nix-zulip}/nix/default.nix" {}).output;
_173-249-5-230 = import ./machines/173-249-5-230/machine.nix; machines = import ./machines.nix;
configuration = machine: modules: configuration = machine: modules:
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
system = machine.system; system = machine.system;
@@ -47,19 +72,30 @@
modules = modules =
modules modules
++ [ ++ [
machine.configuration ./users.nix
machine.hardware-configuration ./secrets.nix
]; ./modules/nixos/common.nix
};
configurationWithHomeManager = machine: (configuration machine
[
agenix.nixosModules.default agenix.nixosModules.default
home-manager.nixosModules.home-manager disko.nixosModules.disko
impermanence.nixosModules.impermanence
nixos-mailserver.nixosModule
noshell.nixosModules.default
phoenix.nixosModules.default
nix-zulip'.nixosModules.zulip
{ {
nixpkgs.overlays = [ nixpkgs.overlays = [
agenix.overlays.default agenix.overlays.default
nur.overlays.default nur.overlays.default
nix-zulip'.overlays.default
]; ];
}
]
++ machine.modules;
};
configurationWithHomeManager = machine: (configuration machine
[
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.extraSpecialArgs = {inherit machine;}; home-manager.extraSpecialArgs = {inherit machine;};
home-manager.users = home-manager.users =
@@ -67,7 +103,7 @@
(name: value: value) (name: value: value)
( (
nixpkgs.legacyPackages.${machine.system}.lib.genAttrs nixpkgs.legacyPackages.${machine.system}.lib.genAttrs
machine.usernames machine.users
( (
name: { name: {
imports = [ imports = [
@@ -80,11 +116,25 @@
) )
); );
} }
impermanence.nixosModules.impermanence
noshell.nixosModules.default
]); ]);
in { in {
nixosConfigurations.${laptop.hostname} = configurationWithHomeManager laptop; nixosConfigurations =
nixosConfigurations.${_173-249-5-230.hostname} = configurationWithHomeManager _173-249-5-230; builtins.mapAttrs
(hostname: value: configurationWithHomeManager value)
machines;
nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration {
pkgs = import nixpkgs {system = "aarch64-linux";};
modules = [
./modules/nix-on-droid/nix-on-droid.nix
{
home-manager.useGlobalPkgs = true;
home-manager.users."andromeda" = {
imports = [
./modules/nix-on-droid/home.nix
];
};
}
];
};
}; };
} }

View File

@@ -0,0 +1,24 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.ens18.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

93
machines.nix Normal file
View File

@@ -0,0 +1,93 @@
{
lenovo = {
hostname = "lenovo";
system = "x86_64-linux";
users = ["andromeda"];
modules = [
# impermanence
./modules/nixos/impermanence.nix
./modules/nixos/impermanence-ssh.nix
# hardware configuration
# includes `system.stateVersion`
./modules/nixos/machines/lenovo.nix
# boot process
# systemd-boot
./modules/nixos/boot/lenovo.nix
# networking
./modules/nixos/laptop.nix
# vpn
./modules/nixos/openvpn-client.nix
# ly display manager
./modules/nixos/ly.nix
# sway window manager
./modules/nixos/sway.nix
# apps
./modules/nixos/steam.nix
# substitutors
./substitutors.nix
];
};
"109-199-104-83" = {
hostname = "109-199-104-83";
system = "x86_64-linux";
users = [];
modules = [
# impermanence
./modules/nixos/impermanence.nix
./modules/nixos/impermanence-ssh.nix
# hardware configuration
# verbatim as `nixos-generate-config` AND `system.stateVersion`
./modules/nixos/machines/109-199-104-83.nix
./modules/nixos/disko/remote.nix
# boot process
# grub boot on /dev/sda
./modules/nixos/boot/109-199-104-83.nix
# networking
./modules/nixos/networking/domains/galaxious.de.nix
# uses cloud-init to network
./modules/nixos/networking/networks/109-199-104-83.nix
# ssh through port 5522 among other things
# andromeda@lenovo is the only user allowed access
./modules/nixos/networking/hard-ssh.nix
./modules/nixos/networking/ssh-as-root.nix
({config, ...}: {users.users.root.openssh.authorizedKeys.keys = [config.pub-keys.ssh.andromeda];})
# simple-nixos-mailserver email server
# mail.domain
./modules/nixos/mailserver.nix
# roundcube webmail client
# webmail.domain
./modules/nixos/roundcube.nix
# matrix homeserver
# matrix.domain
# ./modules/nixos/matrix-conduit.nix
# matrix homeserver
./modules/nixos/matrix-synapse.nix
# BROKEN
# forgejo
# git.domain
# ./modules/nixos/forgejo.nix
# BROKEN
# zulip chat client
# chat.domain
./modules/nixos/zulip.nix
];
};
}

View File

@@ -1,78 +0,0 @@
{
config,
machine,
...
}: {
age.secrets.secret2.file = ../../secrets/secret2.age;
boot.tmp.cleanOnBoot = true;
boot.loader.grub.devices = ["nodev"];
environment.persistence."/nix/persist" = {
enable = true;
hideMounts = true;
directories = [
"/var/log"
"/var/lib/nixos"
"/var/lib/systemd/coredump"
"/etc/NetworkManager/system-connections"
];
files = [
"/etc/machine-id"
"/etc/ly/save.txt"
];
users."mtgmonkey" = {
directories = [
".local/share/zoxide"
".ssh"
];
files = [
".bash_history"
".brush_history"
];
};
};
i18n.defaultLocale = "de_DE.UTF-8";
networking = {
dhcpcd.enable = true;
firewall = {
enable = true;
allowedTCPPorts = [80 443];
allowedUDPPorts = [80 443];
};
hostName = machine.hostname;
domain = "";
};
nix.settings = {
experimental-features = [
"nix-command"
"flakes"
];
allow-import-from-derivation = true;
};
programs.noshell.enable = true;
services.openssh = {
enable = true;
allowSFTP = false;
ports = [5522];
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
KbdInteractiveAuthentication = true;
};
extraConfig = ''
AllowTcpForwarding no
AllowAgentForwarding no
MaxAuthTries 3
MaxSessions 4
TCPKeepAlive no
'';
};
system.stateVersion = "26.05";
time.timeZone = "Europe/Berlin";
users.users."mtgmonkey" = {
isNormalUser = true;
description = "mtgmonkey";
hashedPasswordFile = builtins.toString config.age.secrets.secret2.path;
extraGroups = ["wheel"];
openssh.authorizedKeys.keys = machine.pub-keys.ssh;
};
}

View File

@@ -1,69 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "sdhci_pci"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" = {
#device = "none";
#fsType = "tmpfs";
#options = ["defaults" "size=60%" "mode=755"];
device = "/dev/disk/by-uuid/16c93673-4f0e-4010-a7f4-7ccffb20edb7";
fsType = "btrfs";
options = ["subvol=root"];
};
boot.initrd.postResumeCommands = lib.mkAfter ''
mkdir /btrfs_tmp
mount ${config.fileSystems."/".device} /btrfs_tmp
if [[ -e /btrfs_tmp/root ]]; then
mkdir -p /btrfs_tmp/old_roots
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:$M:%S")
mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
fi
delete_subvolume_recursively() {
IFS=$'\n'
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
delete_subvolume_recursively "/btrfs_tmp/$i"
done
btrfs subvolume delete "$1"
}
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do
delete_subvolume_recursively "$i"
done
btrfs subvolume create /btrfs_tmp/root
umount /btrfs_tmp
'';
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/0e586651-36f4-42b0-99b3-3f0704a894d6";
fsType = "btrfs";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/F425-55BA";
fsType = "vfat";
options = ["fmask=0022" "dmask=0022"];
};
swapDevices = [];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@@ -1,10 +0,0 @@
{
hostname = "173-249-5-230";
usernames = ["mtgmonkey"];
system = "x86_64-linux";
configuration = ./configuration.nix;
hardware-configuration = ./hardware-configuration.nix;
pub-keys = {
ssh = [];
};
}

View File

@@ -1,114 +0,0 @@
{
config,
lib,
machine,
...
}: {
age.secrets = {
secret0.file = ../../secrets/secret0.age;
secret1.file = ../../secrets/secret1.age;
};
boot.loader = {
efi.canTouchEfiVariables = true;
systemd-boot.enable = true;
};
environment.persistence."/nix/persist" = {
enable = true;
hideMounts = true;
directories = [
"/var/log"
"/var/lib/bluetooth"
"/var/lib/nixos"
"/var/lib/systemd/coredump"
"/etc/NetworkManager/system-connections"
"/etc/ssh"
];
files = [
"/etc/machine-id"
"/etc/ly/save.txt"
];
users."andromeda" = {
directories = [
".backups"
".local/share/Anki2"
".local/share/chat.fluffy.fluffychat"
".local/share/zoxide"
".ssh"
"conf"
"Downloads"
"pp"
];
files = [
".bash_history"
".brush_history"
];
};
users."mtgmonkey" = {
directories = [
".local/share/zoxide"
".ssh"
];
files = [
".bash_history"
".brush_history"
];
};
};
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
i18n.defaultLocale = "de_DE.UTF-8";
networking = {
dhcpcd.enable = true;
firewall.enable = true;
hostName = machine.hostname;
networkmanager.enable = true;
};
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"steam"
"steam-original"
"steam-unwrapped"
"steam-run"
];
programs = {
noshell.enable = true;
steam.enable = true;
sway.enable = true;
};
services = {
blueman.enable = true;
displayManager = {
enable = true;
ly.enable = true;
};
libinput.enable = true;
openssh.enable = true;
printing.enable = true;
};
system.stateVersion = "26.05";
time.timeZone = "Europe/Berlin";
users.users."andromeda" = {
isNormalUser = true;
description = "andromeda";
hashedPasswordFile = builtins.toString config.age.secrets.secret0.path;
extraGroups = [
"networkmanager"
"wheel"
];
};
users.users."mtgmonkey" = {
isNormalUser = true;
description = "mtgmonkey";
hashedPasswordFile = builtins.toString config.age.secrets.secret1.path;
extraGroups = [
"networkmanager"
"wheel"
];
};
}

View File

@@ -1,8 +0,0 @@
{
hostname = "lenovo";
usernames = ["andromeda" "mtgmonkey"];
system = "x86_64-linux";
configuration = ./configuration.nix;
hardware-configuration = ./hardware-configuration.nix;
pub-keys.ssh = [];
}

View File

@@ -1,24 +1,18 @@
{ {
config, config,
lib, lib,
machine,
pkgs, pkgs,
... ...
}: { }: {
imports = [./stylix.nix];
xdg.configFile."shell".source = lib.getExe pkgs.brush;
home = { home = {
username = "mtgmonkey"; username = "andromeda";
homeDirectory = "/home/${config.home.username}"; homeDirectory = "/home/${config.home.username}";
stateVersion = "26.05"; stateVersion = "26.05";
packages = [ packages = [
pkgs.acpi
pkgs.brightnessctl
pkgs.brush pkgs.brush
pkgs.dust pkgs.dust
pkgs.fzf pkgs.fzf
pkgs.glow pkgs.glow
pkgs.jmtpfs
pkgs.nix-output-monitor pkgs.nix-output-monitor
pkgs.ranger pkgs.ranger
pkgs.rip2 pkgs.rip2
@@ -74,12 +68,11 @@
settings = { settings = {
user = { user = {
name = config.home.username; name = config.home.username;
email = "${config.home.username}@${machine.hostname}"; email = "${config.home.username}@android";
}; };
init.defaultBranch = "master"; init.defaultBranch = "master";
}; };
}; };
gh.enable = true;
home-manager.enable = true; home-manager.enable = true;
lsd.enable = true; lsd.enable = true;
nvf = { nvf = {

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
environment.packages = [pkgs.git];
system.stateVersion = "26.05";
nix.settings.experimentalFeatures = ["nix-command" "flakes"];
}

View File

@@ -0,0 +1,9 @@
{
boot.loader.grub = {
efiSupport = true;
efiInstallAsRemovable = true;
};
age.identityPaths = [
"/persist/etc/ssh/ssh_host_ed25519_key"
];
}

View File

@@ -0,0 +1,6 @@
{
boot.loader = {
efi.canTouchEfiVariables = true;
systemd-boot.enable = true;
};
}

26
modules/nixos/common.nix Normal file
View File

@@ -0,0 +1,26 @@
{
config,
lib,
...
}: {
# flakes usage
nix.settings.experimental-features = [
"flakes"
"nix-command"
];
# allows users to customize shell in `$XDG_CONFIG_HOME/shell` rather than
# needing /etc/shells. Useful for home-manager. Falls back.
programs.noshell.enable = true;
# cleans /tmp to maintain a tidy system
boot.tmp.cleanOnBoot = true;
networking.domain = lib.mkDefault config.networking.hostName;
# disable lecture
security.sudo.extraConfig = ''Defaults lecture="never"'';
# make users immutable
users.mutableUsers = false;
}

View File

@@ -0,0 +1,64 @@
{
disko.devices = {
disk = {
disk1 = {
device = "/dev/sda";
type = "disk";
content = {
type = "gpt";
partitions = {
# legacy boot
boot = {
name = "boot";
size = "1M";
type = "EF02";
};
# efi boot
esp = {
name = "ESP";
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
# btrfs
# root is on nodev
root = {
size = "100%";
content = {
extraArgs = ["-f"]; # internet told me to, works
type = "btrfs";
subvolumes = {
# nix store
"/nix" = {
mountpoint = "/nix";
};
# persistant directory
"/persist" = {
mountpoint = "/persist";
};
};
};
};
};
};
};
};
nodev = {
# root
"/" = {
fsType = "tmpfs";
mountOptions = [
"defaults"
"mode=755" # stops security complaints
];
};
};
};
}

27
modules/nixos/forgejo.nix Normal file
View File

@@ -0,0 +1,27 @@
{config, ...}: {
services.nginx = {
virtualHosts.${config.services.forgejo.settings.server.DOMAIN} = {
forceSSL = true;
enableACME = true;
extraConfig = ''
client_max_body_size 512M
'';
locations."/".proxyPass = "https://localhost:${builtins.toString config.services.forgejo.settings.server.HTTP_PORT}";
};
};
services.forgejo = {
enable = true;
database.type = "postgres";
lfs.enable = true;
settings = {
server = rec {
DOMAIN = "git.galaxious.de";
ROOT_URL = "https://${DOMAIN}";
HTTP_PORT = 4043;
SSH_PORT = 4022;
};
service.DISABLE_REGISTRATION = false;
};
};
services.openssh.ports = [config.services.forgejo.settings.server.SSH_PORT];
}

View File

@@ -0,0 +1,4 @@
{
# ONLY include this module AFTER a machine has been provisioned
environment.persistence."/persist".directories = ["/etc/ssh"];
}

View File

@@ -0,0 +1,15 @@
{
fileSystems."/persist".neededForBoot = true;
environment.persistence."/persist" = {
enable = true;
hideMounts = true;
directories = [
"/var/log"
"/var/lib/nixos"
"/var/lib/systemd/coredump"
];
files = [
"/etc/machine-id"
];
};
}

37
modules/nixos/laptop.nix Normal file
View File

@@ -0,0 +1,37 @@
{
# bluetooth
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
services.blueman.enable = true;
# locale
i18n.defaultLocale = "de_DE.UTF-8";
time.timeZone = "Europe/Berlin";
# networking
networking = {
firewall.enable = true;
networkmanager.enable = true;
};
# misc
services = {
printing.enable = true;
# trackpad
libinput.enable = true;
# ssh
openssh.enable = true;
};
# impermanence
environment.persistence."/persist".directories = [
# bluetooth
"/var/lib/bluetooth"
# wifi connections
"/etc/NetworkManager/system-connections"
];
}

11
modules/nixos/ly.nix Normal file
View File

@@ -0,0 +1,11 @@
{
services.displayManager = {
enable = true;
ly.enable = true;
};
# TODO needs to be manually updated when new users added
environment.persistence."/persist" = {
directories = ["/etc/ly/custom-sessions"];
files = ["/etc/ly/save.txt"];
};
}

View File

@@ -0,0 +1,25 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = [];
boot.extraModulePackages = [];
swapDevices = [];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
system.stateVersion = "26.05";
}

View File

@@ -1,6 +1,3 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ {
config, config,
lib, lib,
@@ -8,19 +5,13 @@
modulesPath, modulesPath,
... ...
}: { }: {
imports = [ imports = [(modulesPath + "/installer/scan/not-detected.nix")];
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "sdhci_pci"]; boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "sdhci_pci"];
boot.initrd.kernelModules = []; boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"]; boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = []; boot.extraModulePackages = [];
fileSystems."/" = { fileSystems."/" = {
#device = "none";
#fsType = "tmpfs";
#options = ["defaults" "size=60%" "mode=755"];
device = "/dev/disk/by-uuid/5455cfb4-0efd-4f55-b496-d2cab3f419b7"; device = "/dev/disk/by-uuid/5455cfb4-0efd-4f55-b496-d2cab3f419b7";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=root"]; options = ["subvol=root"];
@@ -48,12 +39,12 @@
done done
btrfs subvolume create /btrfs_tmp/root btrfs subvolume create /btrfs_tmp/root
mkdir /btrfs_tmp/root/nix mkdir /btrfs_tmp/root/persist
mkdir /btrfs_tmp/root/etc mkdir /btrfs_tmp/root/etc
mount ${config.fileSystems."/nix".device} /btrfs_tmp/root/nix mount ${config.fileSystems."/persist".device} /btrfs_tmp/root/persist -o subvol=persist
cp /btrfs_tmp/root/nix/persist/etc/ssh /btrfs_tmp/root/etc/ssh -r cp /btrfs_tmp/root/persist/etc/ssh /btrfs_tmp/root/etc/ssh -r
umount /btrfs_tmp/root/nix umount /btrfs_tmp/root/persist
rm -r /btrfs_tmp/root/nix rm -r /btrfs_tmp/root/persist
umount /btrfs_tmp umount /btrfs_tmp
''; '';
@@ -62,6 +53,12 @@
fsType = "btrfs"; fsType = "btrfs";
}; };
fileSystems."/persist" = {
device = "/dev/disk/by-uuid/5455cfb4-0efd-4f55-b496-d2cab3f419b7";
fsType = "btrfs";
options = ["subvol=persist"];
};
fileSystems."/boot" = { fileSystems."/boot" = {
device = "/dev/disk/by-uuid/F425-55BA"; device = "/dev/disk/by-uuid/F425-55BA";
fsType = "vfat"; fsType = "vfat";
@@ -72,4 +69,5 @@
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
system.stateVersion = "26.05";
} }

View File

@@ -0,0 +1,57 @@
{config, ...}: {
mailserver = {
enable = true;
stateVersion = 3;
# domain bs
fqdn = "mail.${config.networking.domain}";
domains = ["${config.networking.domain}"];
x509.useACMEHost = config.mailserver.fqdn;
loginAccounts = {
# test acc
"test@${config.networking.domain}" = {
hashedPasswordFile = builtins.toString config.age.secrets.mailserver-acc-test-pw.path;
};
"admin@${config.networking.domain}" = {
hashedPasswordFile = builtins.toString config.age.secrets.mailserver-acc-admin-pw.path;
aliases = ["@${config.networking.domain}"];
};
};
};
# put dkim key into /etc for declarability
mailserver.dkimKeyDirectory = "/etc/dkim";
environment.etc."dkim/${config.networking.domain}.${config.mailserver.dkimSelector}.key" = {
source = config.age.secrets."dkim-${config.networking.domain}.${config.mailserver.dkimSelector}.key".path;
mode = "600";
user = config.services.rspamd.user;
group = config.services.rspamd.group;
};
# does acme for me
services.nginx = {
enable = true;
virtualHosts = {
"mail.${config.networking.domain}" = {
forceSSL = true;
enableACME = true;
};
};
};
security.acme = {
acceptTerms = true;
defaults.email = "mtgmonket@gmail.com";
};
# persist directories per the backup guidelines
environment.persistence."/persist" = {
directories = [
# not needed bc the dkim dir is declared
# "/var/dkim"
"/var/vmail"
"/var/lib/redis-rspamd"
"/var/lib/acme"
];
};
}

View File

@@ -0,0 +1,82 @@
{
config,
pkgs,
...
}: let
well_known_server = pkgs.writeText "well-known-matrix-server" ''
{
"m.server": "matrix.${config.services.matrix-conduit.settings.global.server_name}"
}
'';
well_known_client = pkgs.writeText "well-known-matrix-client" ''
{
"m.homeserver": {
"base_url": "https://matrix.${config.services.matrix-conduit.settings.global.server_name}"
}
'';
in {
services.matrix-conduit = {
enable = true;
settings.global = {
server_name = "${config.networking.domain}";
};
};
services.nginx = {
enable = true;
virtualHosts = {
"matrix.${config.services.matrix-conduit.settings.global.server_name}" = {
forceSSL = true;
enableACME = true;
listen = [
{
addr = "0.0.0.0";
port = 443;
ssl = true;
}
{
addr = "0.0.0.0";
port = 8448;
ssl = true;
}
];
locations."/_matrix/" = {
proxyPass = "http://backend_conduit$request_uri";
proxyWebsockets = true;
extraConfig = ''
proxy_set_header Host $host;
proxy_buffering off;
'';
};
extraConfig = ''
merge_slashes off;
'';
};
"${config.services.matrix-conduit.settings.global.server_name}" = {
forceSSL = true;
enableACME = true;
locations."/.well-known/matrix/server/" = {
alias = "${well_known_server}";
extraConfig = ''
default_type application/json;
'';
};
locations."/.well-known/matrix/client/" = {
alias = "${well_known_client}";
extraConfig = ''
default_type application/json;
add_header Access-Control-Allow-Origin "";
'';
};
};
};
upstreams = {
backend-conduit = {
servers = {
"localhost:${builtins.toString config.services.matrix-conduit.settings.global.port}" = {};
};
};
};
};
networking.firewall.allowedTCPPorts = [8448];
networking.firewall.allowedUDPPorts = [8448];
}

View File

@@ -0,0 +1,65 @@
{
pkgs,
lib,
config,
...
}: let
fqdn = "${config.networking.hostName}.${config.networking.domain}";
baseUrl = "https://${fqdn}";
clientConfig."m.homeserver".base_url = baseUrl;
serverConfig."m.server" = "${fqdn}:443";
mkWellKnown = data: ''
default_type application/json;
add_header Access-Control-Allow-Origin *;
return 200 '${builtins.toJSON data}';
'';
in {
services.postgresql.enable = true;
services.nginx = {
enable = true;
recommendedTlsSettings = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
recommendedProxySettings = true;
virtualHosts = {
"${config.networking.domain}" = {
enableACME = true;
forceSSL = true;
locations."= /.well-known/matrix/server".extraConfig = mkWellKnown serverConfig;
locations."= /.well-known/matrix/client".extraConfig = mkWellKnown clientConfig;
};
"${fqdn}" = {
enableACME = true;
forceSSL = true;
locations."/".extraConfig = ''
return 404;
'';
locations."/_matrix".proxyPass = "http://[::1]:8008";
locations."/_synapse/client".proxyPass = "http://[::1]:8008";
};
};
};
services.matrix-synapse = {
enable = true;
settings.server_name = config.networking.domain;
settings.public_baseurl = baseUrl;
settings.listeners = [
{
port = 8008;
bind_addresses = ["::1"];
type = "http";
tls = false;
x_forwarded = true;
resources = [
{
names = [
"client"
"federation"
];
compress = true;
}
];
}
];
};
}

View File

@@ -0,0 +1,3 @@
{
networking.domain = "galaxious.de";
}

View File

@@ -0,0 +1,19 @@
{
services.openssh = {
enable = true;
allowSFTP = false;
ports = [5522];
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
KbdInteractiveAuthentication = true;
};
extraConfig = ''
AllowTcpForwarding no
AllowAgentForwarding no
MaxAuthTries 3
MaxSessions 4
TCPKeepAlive no
'';
};
}

View File

@@ -0,0 +1,15 @@
{
networking = {
useDHCP = false;
hostName = "109-199-104-83";
firewall = {
enable = true;
allowedTCPPorts = [80 443];
allowedUDPPorts = [80 443];
};
};
services.cloud-init = {
enable = true;
network.enable = true;
};
}

View File

@@ -0,0 +1,3 @@
{lib, ...}: {
services.openssh.settings.PermitRootLogin = lib.mkForce "yes";
}

View File

@@ -0,0 +1,11 @@
{
services.openvpn.servers = {
"173.249.5.230" = {config = ''config /etc/openvpn-confs/173.249.5.230.ovpn'';};
};
environment.persistence."/persist".directories = ["/etc/openvpn-confs"];
# turns out disabling ipv6 is a bad idea; I'm just going to enable v6 on the remote xD
# networking.enableIPv6 = lib.mkForce false;
# workaround; NetworkManager reenables ipv6 without the following
# boot.kernelParams = ["ipv6.disable=1"];
}

View File

@@ -0,0 +1,16 @@
{config, ...}: {
services.roundcube = {
enable = true;
hostName = "webmail.${config.networking.domain}";
extraConfig = ''
$config['imap_host'] = "ssl://${config.mailserver.fqdn}";
$config['smtp_host'] = "ssl://${config.mailserver.fqdn}";
$config['smtp_user'] = "%u";
$config['smtp_pass'] = "%p";
'';
};
environment.persistence."/persist".directories = [
"/var/lib/roundcube"
"/var/lib/postgresql"
];
}

10
modules/nixos/steam.nix Normal file
View File

@@ -0,0 +1,10 @@
{lib, ...}: {
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"steam"
"steam-original"
"steam-unwrapped"
"steam-run"
];
programs.steam.enable = true;
}

3
modules/nixos/sway.nix Normal file
View File

@@ -0,0 +1,3 @@
{
programs.sway.enable = true;
}

54
modules/nixos/zulip.nix Normal file
View File

@@ -0,0 +1,54 @@
{config, ...}: {
services.zulip = {
enable = true;
# lets it set up my postgresql for me
enablePostgresqlLocally = true;
# host domain
host = "chat.${config.networking.domain}";
# secrets; head rolled on keyboard for all :)
camoKeyFile = builtins.toString config.age.secrets.zulip-camoKey.path;
rabbitmqPasswordFile = builtins.toString config.age.secrets.zulip-rabbitmqPassword.path;
secretKeyFile = builtins.toString config.age.secrets.zulip-secretKey.path;
sharedSecretKeyFile = builtins.toString config.age.secrets.zulip-sharedSecretKey.path;
avatarSaltKeyFile = builtins.toString config.age.secrets.zulip-avatarSaltKey.path;
# TODO check for parity with `mailserver-acc-admin-pw.age`
extraSecrets.email_password = builtins.toString config.age.secrets.zulip-extraSecrets-email_password.path;
# settings
zulipSettings = rec {
# email users
ZULIP_ADMINISTRATOR = "admin@${config.networking.domain}";
EMAIL_HOST_USER = ZULIP_ADMINISTRATOR;
# configure mailserver port
EMAIL_HOST = config.mailserver.fqdn;
EMAIL_USE_SSL = true;
EMAIL_PORT = 465;
# setting to allow realm creation; probably unsafe, might delete later :3
OPEN_REALM_CREATION = true;
# send all noreply emails from `admin@galaxious.de`
# TODO configure admin to send from any address
ADD_TOKENS_TO_NOREPLY_ADDRESS = false;
NOREPLY_EMAIL_ADDRESS = ZULIP_ADMINISTRATOR;
# domain name
EXTERNAL_HOST = config.services.zulip.host;
};
};
# persist
environment.persistence."/persist".directories = [
# messages
"/var/lib/rabbitmq"
# uploads
"/var/lib/zulip"
# contrived, but in the store a couple layers down
# "/var/lib/redis-zulip"
];
}

11
modules/template.nix Normal file
View File

@@ -0,0 +1,11 @@
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [];
options = {};
config = {};
}

24
pub-keys.nix Normal file
View File

@@ -0,0 +1,24 @@
{
age.secrets = {
andromeda-pw.file = ./secrets/andromeda-pw.age;
conduit-secretFile.file = ./secrets/conduit-secretFile.age;
"dkim-galaxious.de.mail.key".file = ./secrets/dkim-galaxious.de.mail.key.age;
mtgmonkey-pw.file = ./secrets/mtgmonkey-pw.age;
mailserver-acc-test-pw.file = ./secrets/mailserver-acc-test-pw.age;
mailserver-acc-admin-pw.file = ./secrets/mailserver-acc-admin-pw.age;
"mailserver-acc-zulip+admin-pw".file = "${./secrets}/mailserver-acc-zulip+admin-pw.age";
zulip-avatarSaltKey.file = ./secrets/zulip-avatarSaltKey.age;
zulip-camoKey.file = ./secrets/zulip-camoKey.age;
zulip-extraSecrets-email_password.file = ./secrets/zulip-extraSecrets-email_password.age;
zulip-rabbitmqPassword.file = ./secrets/zulip-rabbitmqPassword.age;
zulip-secretKey.file = ./secrets/zulip-secretKey.age;
zulip-sharedSecretKey.file = ./secrets/zulip-sharedSecretKey.age;
};
pub-keys = {
ssh = {
andromeda = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJy2VD362wUcu0lKj2d6OIU8dbAna0Lu/NaAYIj8gdIA andromeda@lenovo";
lenovo = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHG4eqsLTq2os2mxfwhys3BpVnowcJrqt2CbRFzN2pJb root@lenovo";
_109-199-104-83 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBH5TA6Br8K4xTjD5YcXQDh4UQSvuE0lEs1UxUytDiAn root@109-199-104-83";
};
};
}

10
secrets.nix Normal file
View File

@@ -0,0 +1,10 @@
{lib, ...}: {
imports = [./pub-keys.nix];
options = {
pub-keys.ssh = lib.mkOption {
type = lib.types.attrsOf lib.types.str;
default = {};
description = "set of public keys as `name = key`";
};
};
}

8
secrets/andromeda-pw.age Normal file
View File

@@ -0,0 +1,8 @@
age-encryption.org/v1
-> ssh-ed25519 mT2fyg ixFM7swaItfNnTRVSdTm1wZJ8lHUv7tDOgSXo1OpgCc
lf8/ChfcpgYkK8mTS9Zk++toOu0KNh88S+Lqu4a0UIw
-> ssh-ed25519 UHxfvA hbsRwdzU1IP3K/gH0btUOQ8hZer8Kgq+RqzcEVrCqTE
iSVh+yeypHoalRhaRM2XMlBvtO8HCyatDnWgUyC3GWU
--- hcs6DJZRvjoKDPI/cjUXRfM7+06PNJvWqjkvJof/bSs
Bo<1A>p<EFBFBD>Qlg-<2D>\<5C>=ƙ ڼ <0B><><1E><>sv<13><>~<7E><>O<EFBFBD><4F>{Rx<1E>IErô<>s<EFBFBD>1<1F><>v<EFBFBD><76><EFBFBD>:<<3C>
i<EFBFBD><EFBFBD><EFBFBD>1<EFBFBD>v<0E><03>K<EFBFBD><4B><07><16><>*<2A> |<7C> <20><><EFBFBD><EFBFBD><EFBFBD>5[{<7B>\<5C>

View File

@@ -0,0 +1,9 @@
age-encryption.org/v1
-> ssh-ed25519 mT2fyg x0n1JToeD7bRsDYJpv0HFzQYB9YxxiSqt+dG6elG1Eg
vspLec9Vm6fvJnlDGjzezThc1qeIYyWncBxYwsE/6rg
-> ssh-ed25519 UHxfvA nOlZo53SINXJs8tt/vdoiGjMnIW/lYZVdI8TJfAFqxE
XlxvrHDFlm8c7odfNbBw0/QeYuCj5e4VValql5JNNgg
-> ssh-ed25519 yXDKAA Rf+obXBUKxOcMqrb6rlOSfZGyjkj1PnRvHUSDToj6Tw
XV/3FmC48Wcg9r3C5soRKBwOcBgat2ueAa8pU1MUYLE
--- l/eEq13iyiddR9Rgf47Mv8JxPfjINwCnU4pd3KyxMVQ
^P%<25>Ϧ<EFBFBD><CFA6>}<7D><>M<EFBFBD><4D><EFBFBD>ه<DFA2>Q<>?d^<04>Y<EFBFBD> <09>~<7E>Tu<54><75><EFBFBD>o<EFBFBD>f<EFBFBD><66><EFBFBD>7<>n<1D>'!'͓<><10><><EFBFBD>]d͇0>v<>ǟ<EFBFBD><12>.<2E><>E]<1D><>ԇ|<7C>>d<><64>*wDɏ<44><1A><><EFBFBD><EFBFBD><0E><>)cH<63><48><EFBFBD>@W<>v*<2A>Wk<57><6B><EFBFBD>N<EFBFBD><4E>R<EFBFBD>F I@<40><>;9=u<><75><EFBFBD><EFBFBD><7F><EFBFBD><EFBFBD>τ<EFBFBD>,<01><><EFBFBD>)<29>>b<><03>:O<>J<EFBFBD>=<3D>W

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,9 @@
age-encryption.org/v1
-> ssh-ed25519 mT2fyg at6Q9eK1o8Mk0+fJh+mnIVrvV1tASV+PGuV8MXuwR2c
cm3wvsLAemeeTFok7yBocNlfwewKruPnymG+wsT5g+Y
-> ssh-ed25519 UHxfvA aaQqfrUfUnLzwUVT6nCRPIAVlIhIWAJcPyeg3J6BQUI
4sh8ZV14csafSs8yAtFZIccSkiz6YnseV3DJcuhw7dQ
-> ssh-ed25519 yXDKAA KmwRbJURujQhlqOIVxzlVjyvaYRfyuJAVGWMZdkFaAE
mX083o2XdnnYgqLs5NeppwMbFHDHTucMiHHZuYdzLvo
--- Ay/SP2CXGOhSzO4KoiXFQhJMMdHaecxXOtNkGBK/RO0
Z<11>?<14><0E><1A><><EFBFBD>B<EFBFBD><1E>F<EFBFBD>9_N`<60><>8<EFBFBD><38><EFBFBD>&<26><><1D>@<40><>)q<>7<EFBFBD>a<11>O

View File

@@ -0,0 +1,10 @@
age-encryption.org/v1
-> ssh-ed25519 mT2fyg sRu0FIphSJVMBcC02mo1YuZdy3i2+/jMeN3ROvxp4kM
sEwx23t3IAauISKesq+110ZKRKxQv3Zesd0AJufYOLs
-> ssh-ed25519 UHxfvA +YaJGPRT7nX2CqVzw1ixNLpW7MfzEnj44pSwj4iUwhI
E2U6Q+4uesNCWK7uVSztrA84TU/n/xLFm3PJH0hO/EM
-> ssh-ed25519 yXDKAA V2kygl0BK/oYpKnnheslBO2YqXFdQWFgtqfmDNdgolc
NpJNN4nfrbgOav8Y38C9DwKFZH+QTRp/US/8kyo9m0o
--- LdqtfywtHOAy3AZ7AexZU0TJMU/ugq+ZYN07706rNxY
<EFBFBD>
U$<24>Ap<>nG<6E>Neɕ<65>u<EFBFBD>y`!<21>ʤ<EFBFBD><CAA4><EFBFBD>f;ipv<70>Y<EFBFBD><59>V_3<5F><33>N+<06><><EFBFBD>k#<23>{<7B><><EFBFBD><EFBFBD><EFBFBD>W<EFBFBD>*<2A>n(<28><0F><03><><14><>ջG6<47><36> ݈yc`<60><>q<EFBFBD>:$K]?͗b=<3D>'<27>^<5E>9

7
secrets/mtgmonkey-pw.age Normal file
View File

@@ -0,0 +1,7 @@
age-encryption.org/v1
-> ssh-ed25519 mT2fyg WZNwnBmikWIb4rlH89iIQHouM7cw07/E/KXz/AVv3V8
FxLaO1zM0aGztJAsq+lgrM8gFogKY76Wcs1vYxhA19g
-> ssh-ed25519 UHxfvA YIpS5r25kHVJtG3+kDVUvAPyTKDsRPG/jHwXmiD44SA
FKAmC669aQzSbjBjbQbzCixdqnCXnb/JJRQo2MgEZgw
--- xvwJ5oYHR3T1D44fl/aeAVjZglnKhq0JKZr9YecC3EE
<EFBFBD>ow<6F>M<EFBFBD><4D><EFBFBD><EFBFBD>{<7B>8<EFBFBD>m<EFBFBD>$/<2F>1<EFBFBD><1A>0<EFBFBD>ts<74><73><EFBFBD>X<EFBFBD><58><1D><><EFBFBD><EFBFBD><EFBFBD><43><D793><EFBFBD><EFBFBD>\<13>h<>-}<7D><>E,<2C> <20><><1E>,dxdX<>TAk<41><6B><18>

Binary file not shown.

Binary file not shown.

View File

@@ -1,7 +0,0 @@
age-encryption.org/v1
-> ssh-ed25519 mT2fyg DSrFJv1cg7XUWGT8H60d+IdbQJKIGVc0FznYD3ScHxY
x75LtCRBWRH+Y541dDKE2vLk9kOZNxbFI68cDvaeJ4c
-> ssh-ed25519 UHxfvA 2jLPahOP6AKIn66RM4vUWAl4eUhNgZblKB2z/Wa6ghw
IPFBVfk+c1lO43jc58TmdUM9+pOBad8M7v5lxpNJLOE
--- Bv3SJdghwzga9GD5Fz1/62gelkFqjjgRxoiv4S7x1Nc
[<5B><>

View File

@@ -1,8 +1,33 @@
let let
andromeda = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJy2VD362wUcu0lKj2d6OIU8dbAna0Lu/NaAYIj8gdIA andromeda@lenovo"; pub-keys = (import ../pub-keys.nix).pub-keys;
lenovo = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHG4eqsLTq2os2mxfwhys3BpVnowcJrqt2CbRFzN2pJb root@lenovo"; andromeda = pub-keys.ssh.andromeda;
lenovo = pub-keys.ssh.lenovo;
_109-199-104-83 = pub-keys.ssh._109-199-104-83;
in { in {
"secret0.age".publicKeys = [andromeda lenovo]; # user passwords
"secret1.age".publicKeys = [andromeda lenovo]; "andromeda-pw.age".publicKeys = [andromeda lenovo];
"secret2.age".publicKeys = [andromeda lenovo]; "mtgmonkey-pw.age".publicKeys = [andromeda lenovo];
# contains the following env
# CONDUIT_JWT_SECRET
# CONDUIT_TURN_SECRET
"conduit-secretFile.age".publicKeys = [andromeda lenovo _109-199-104-83];
# dkim private keys
"dkim-galaxious.de.mail.key.age".publicKeys = [andromeda lenovo _109-199-104-83];
# mail account passwords
"mailserver-acc-test-pw.age".publicKeys = [andromeda lenovo _109-199-104-83];
"mailserver-acc-admin-pw.age".publicKeys = [andromeda lenovo _109-199-104-83];
"mailserver-acc-zulip+admin-pw.age".publicKeys = [andromeda lenovo _109-199-104-83];
# zulip keys
"zulip-avatarSaltKey.age".publicKeys = [andromeda lenovo _109-199-104-83];
"zulip-camoKey.age".publicKeys = [andromeda lenovo _109-199-104-83];
"zulip-rabbitmqPassword.age".publicKeys = [andromeda lenovo _109-199-104-83];
"zulip-secretKey.age".publicKeys = [andromeda lenovo _109-199-104-83];
"zulip-sharedSecretKey.age".publicKeys = [andromeda lenovo _109-199-104-83];
# zulip-secrets.conf values
"zulip-extraSecrets-email_password.age".publicKeys = [andromeda lenovo _109-199-104-83];
} }

Binary file not shown.

10
secrets/zulip-camoKey.age Normal file
View File

@@ -0,0 +1,10 @@
age-encryption.org/v1
-> ssh-ed25519 mT2fyg 5ADzKAtycqfFpqW/dp71FTaK2gchzdWFNqxPyZ6deSY
+aISA4YwF1l9S0fmE84wOvAJpM221bwPDYvXELTVv9k
-> ssh-ed25519 UHxfvA uKYcpPbaXA4r1OmlkuiIu/EqQ3IiHR7JpItnVgTaW2g
LjySgI4mTlaZY81IJc6DmBh43l2qeGlQnZi+rOlbtb8
-> ssh-ed25519 yXDKAA TMwoM06ZJsjkZ7eLguxqYB05jcRn+tTgVzE7WQIf0mw
vKwCkWsywGsgVv6Y278Mi28MhCYBRRUnfg4+EouOw+0
--- CScrim9wya9AhElXBtKBR3XBZDL83/g3MTfdF258GJ8
K#<23>>8}c<><EFBFBD><7F>}8<><38>L<04>(<28><>c<EFBFBD><63>
<EFBFBD>w1<EFBFBD>"O<><4F>

View File

@@ -0,0 +1,10 @@
age-encryption.org/v1
-> ssh-ed25519 mT2fyg IOcD4r19Gx2AvjusnnJDHQXr/U4Ti6qKr01I9lNQDQE
fCwouMQPvhkyzehszuv0YhSfNh9zGKaFNDKaTZT0rD0
-> ssh-ed25519 UHxfvA e95raPehUz6T2FR/eT8kzfrxt/Ou6kKsqi7z/3BkfwU
uHymqnY3t7IwpxWkN8xen3Vsy6R7VMoj+fR0zPnPinY
-> ssh-ed25519 yXDKAA nlR1prGysW+k8gq2npEiboFqoo9jKQ5ISxRiiCFlb0s
kaGOvlQgO0nOAl12mMKvafa9ezmy8XdUC2tVPuBG4iw
--- MRFAGURoyediqNSjGxr57a0w6n9lH2zVjfyrUZcyAYw
z<EFBFBD>0

Binary file not shown.

BIN
secrets/zulip-secretKey.age Normal file

Binary file not shown.

Binary file not shown.

8
substitutors.nix Normal file
View File

@@ -0,0 +1,8 @@
{
# spectrum
nix.settings.substituters = ["https://cache.dataaturservice.se/spectrum/"];
nix.settings.trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"spectrum-os.org-2:foQk3r7t2VpRx92CaXb5ROyy/NBdRJQG2uX2XJMYZfU="
];
}

45
users.nix Normal file
View File

@@ -0,0 +1,45 @@
{
config,
lib,
machine,
...
}: let
machines = import ./machines.nix;
in {
users.users =
builtins.mapAttrs
(name: value: lib.mkIf (builtins.elem name machine.users) value)
{
"andromeda" = {
isNormalUser = true;
description = "andromeda";
hashedPasswordFile = builtins.toString config.age.secrets.andromeda-pw.path;
extraGroups = [
"networkmanager"
"wheel"
];
};
};
environment.persistence."/persist".users = lib.mkIf config.environment.persistence."/persist".enable (
builtins.mapAttrs
(name: value: lib.mkIf (builtins.elem name machine.users) value)
{
"andromeda" = {
directories = [
".backups"
".local/share/Anki2"
".local/share/chat.fluffy.fluffychat"
".local/share/zoxide"
".ssh"
"conf"
"Downloads"
"pp"
];
files = [
".bash_history"
".brush_history"
];
};
}
);
}

View File

@@ -6,82 +6,16 @@
... ...
}: let }: let
background-path = ".config/sway/background.png"; background-path = ".config/sway/background.png";
sway_config = builtins.toFile "sway_config" '' sway_config =
set $mod Mod4 pkgs.substitute
set $left h {
set $down j src = ./sway_config;
set $up k substitutions = [
set $right l "--replace"
set $term alacritty "@backgroundImagePath@"
set $menu wmenu-run "${config.home.homeDirectory}/${background-path}"
set $screenshot grim -g "$(slurp)" ];
floating_modifier $mod normal };
workspace_layout stacking
output * bg ${config.home.homeDirectory}/${background-path} fill
# launch programs
bindsym $mod+Shift+Return exec $term
bindsym $mod+Shift+d exec $menu
bindsym $mod+Shift+a exec anki
bindsym $mod+Shift+q exec librewolf
bindsym $mod+Shift+s exec $screenshot
bindsym $mod+Shift+c kill
bindsym $mod+Shift+r reload
bindsym $mod+Shift+Alt+q exit
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 0
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 0
bindsym $mod+f fullscreen
bindsym $mod+Shift+space floating toggle
bindsym $mod+Shift+minus move scratchpad
bindsym $mod+minus scratchpad show
bindsym --locked XF86AudioMute exec pactl set-sink-mute \@DEFAULT_SINK@ toggle
bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume \@DEFAULT_SINK@ -5%
bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume \@DEFAULT_SINK@ +5%
bindsym --locked XF86AudioMicMute exec pact set-source-mute \@DEFAULT_SOURCE@ toggle
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
bindsym --locked XF86MonbrightnessUp exec brightnessctl set 5%+
default_border none
font pango:monospace 0.001
titlebar_border_thickness 0
titlebar_padding 0
'';
in { in {
imports = [./stylix.nix]; imports = [./stylix.nix];
xdg.configFile."shell".source = lib.getExe pkgs.brush; xdg.configFile."shell".source = lib.getExe pkgs.brush;
@@ -157,6 +91,81 @@ in {
}; };
}; };
fastfetch.enable = true; fastfetch.enable = true;
firefox = {
enable = true;
package = pkgs.firefox.override {
cfg.enableTridactylNative = true;
};
profiles.${config.home.username} = {
extensions.packages = [
pkgs.nur.repos.rycee.firefox-addons.tridactyl
];
search = {
default = "ddghtml";
privateDefault = "ddghtml";
order = [
"wiki"
"options"
"packages"
"repos"
];
engines = {
"packages" = {
urls = [
{
template = "https://search.nixos.org/packages";
params = [
{
name = "channel";
value = "unstable";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
};
"options" = {
urls = [
{
template = "https://search.nixos.org/options";
params = [
{
name = "channel";
value = "unstable";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
};
"wiki" = {
urls = [
{
template = "https://wiki.nixos.org/w/index.php";
params = [
{
name = "search";
value = "{searchTerms}";
}
];
}
];
};
};
};
settings = {
"extensions.autoDisableScopes" = 0;
};
};
};
git = { git = {
enable = true; enable = true;
settings = { settings = {
@@ -169,15 +178,6 @@ in {
}; };
gh.enable = true; gh.enable = true;
home-manager.enable = true; home-manager.enable = true;
librewolf = {
enable = true;
package = pkgs.librewolf.override {
cfg.enableTridactylNative = true;
};
profiles.${config.home.username}.extensions.packages = [
pkgs.nur.repos.rycee.firefox-addons.tridactyl
];
};
lsd.enable = true; lsd.enable = true;
nvf = { nvf = {
enable = true; enable = true;

View File

@@ -0,0 +1,79 @@
set $mod Mod4
set $left h
set $down j
set $up k
set $right l
set $term alacritty
set $menu wmenu-run
set $screenshot grim -g "$(slurp)"
floating_modifier $mod normal
workspace_layout stacking
output * bg @backgroundImagePath@ fill
bindsym $mod+Shift+Return exec $term
bindsym $mod+Shift+d exec $menu
bindsym $mod+Shift+a exec anki
bindsym $mod+Shift+q exec firefox
bindsym $mod+Shift+s exec $screenshot
bindsym $mod+Shift+c kill
bindsym $mod+Shift+r reload
bindsym $mod+Shift+Alt+q exit
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 0
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 0
seat * hide_cursor 100
input type:touchpad events disabled
bindsym $mod+r exec 'swaymsg "seat * hide_cursor 100"; swaymsg "input type:touchpad events disabled"'
bindsym $mod+t exec 'swaymsg "seat * hide_cursor 0"; swaymsg "input type:touchpad events enabled"'
bindsym $mod+f fullscreen
bindsym $mod+Shift+space floating toggle
bindsym $mod+Shift+minus move scratchpad
bindsym $mod+minus scratchpad show
bindsym --locked XF86AudioMute exec pactl set-sink-mute \@DEFAULT_SINK@ toggle
bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume \@DEFAULT_SINK@ -5%
bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume \@DEFAULT_SINK@ +5%
bindsym --locked XF86AudioMicMute exec pact set-source-mute \@DEFAULT_SOURCE@ toggle
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 2%-
bindsym --locked XF86MonbrightnessUp exec brightnessctl set 2%+
default_border none
font pango:monospace 0.001
titlebar_border_thickness 0
titlebar_padding 0

View File

@@ -1,29 +0,0 @@
{
pkgs,
config,
...
}: {
stylix = {
enable = true;
# rebecca has lavener bkg
# tube has dark gray bkg
# silk-light is light theme
base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-material-dark-hard.yaml";
polarity = "dark";
fonts = {
monospace = {
package = pkgs.miracode;
name = "Miracode";
};
serif = config.stylix.fonts.sansSerif;
emoji = {
package = pkgs.noto-fonts-color-emoji;
name = "Noto Color Emoji";
};
sizes = {
applications = 12;
terminal = 10;
};
};
};
}