Skip to content

Commit d26dcbb

Browse files
Merge pull request #18 from 99linesofcode/impermanence
Impermanence
2 parents e80bc37 + 64e670c commit d26dcbb

38 files changed

+224
-98
lines changed

flake.lock

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
# NOTE: nix version is manually kept in sync with home-manager
2020
inputs = {
2121
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
22-
home-manager = {
23-
url = "github:nix-community/home-manager";
24-
inputs.nixpkgs.follows = "nixpkgs";
25-
};
22+
impermanence.url = "github:nix-community/impermanence";
2623
sops-nix = {
2724
url = "github:Mic92/sops-nix";
2825
inputs.nixpkgs.follows = "nixpkgs";
@@ -31,14 +28,19 @@
3128
url = "github:nix-community/disko";
3229
inputs.nixpkgs.follows = "nixpkgs";
3330
};
31+
home-manager = {
32+
url = "github:nix-community/home-manager";
33+
inputs.nixpkgs.follows = "nixpkgs";
34+
};
3435
};
3536

3637
outputs =
3738
{
3839
nixpkgs,
3940
self,
40-
disko,
4141
sops-nix,
42+
disko,
43+
impermanence,
4244
...
4345
}@inputs:
4446
let
@@ -65,6 +67,7 @@
6567
nixpkgs.lib.nixosSystem {
6668
modules = [
6769
disko.nixosModules.disko
70+
impermanence.nixosModules.impermanence
6871
(import ./modules)
6972
(import ./users)
7073
]

hosts/luna/default.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ in
2323
environment.systemPackages = with pkgs; [
2424
busybox
2525
git
26+
rustdesk
2627
];
2728

2829
hardware = {
@@ -38,6 +39,7 @@ in
3839
efi.enable = true;
3940
encryption.enable = true;
4041
btrfs.enable = true;
42+
impermanence.enable = true;
4143
swap.enable = true;
4244

4345
network = {

hosts/luna/disko.nix

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ in
3737
settings = {
3838
allowDiscards = true;
3939
};
40-
# TODO: generate prior to nixos-anywhere install
41-
# passwordFile = "/tmp/secret.key"; # commenting will cause Disko to prompt for a passphrase
4240
content = {
4341
type = "btrfs";
4442
extraArgs = [ "-f" ];
@@ -50,6 +48,12 @@ in
5048
"noatime"
5149
];
5250
};
51+
"/root-blank" = {
52+
mountOptions = [
53+
"compress=zstd"
54+
"noatime"
55+
];
56+
};
5357
"/home" = {
5458
mountpoint = "/home";
5559
mountOptions = [

modules/.gitkeep

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ let
55
in
66
with lib;
77
{
8-
options = {
9-
host.PLACEHOLDER.enable = mkEnableOption "PLACEHOLDER";
8+
options.host.PLACEHOLDER = {
9+
enable = mkEnableOption "PLACEHOLDER";
1010
};
1111

1212
config = mkIf cfg.enable {

modules/avahi.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ let
55
in
66
with lib;
77
{
8-
options = {
9-
host.avahi.enable = mkEnableOption "avahi";
8+
options.host.avahi = {
9+
enable = mkEnableOption "avahi";
1010
};
1111

1212
config = mkIf cfg.enable {

modules/bluetooth.nix

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ let
99
in
1010
with lib;
1111
{
12-
options = {
13-
host.bluetooth.enable = mkEnableOption "bluetooth";
12+
options.host.bluetooth = {
13+
enable = mkEnableOption "bluetooth";
1414
};
1515

1616
config = mkIf cfg.enable {
@@ -32,5 +32,9 @@ with lib;
3232
deps = [ ];
3333
};
3434
};
35+
36+
host.impermanence.directories = mkIf config.host.impermanence.enable [
37+
"/var/lib/bluetooth"
38+
];
3539
};
3640
}

modules/borgmatic.nix

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{ config, lib, ... }:
2+
3+
let
4+
cfg = config.host.borgmatic;
5+
in
6+
with lib;
7+
{
8+
options.host.borgmatic = {
9+
enable = mkEnableOption "borgmatic";
10+
};
11+
12+
config = mkIf cfg.enable {
13+
services.borgmatic = {
14+
enable = true;
15+
settings = {
16+
repositories = [
17+
{
18+
label = "Google Drive";
19+
path = "rclone:gdrive/backup";
20+
}
21+
];
22+
};
23+
};
24+
};
25+
}

modules/btrfs.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ let
55
in
66
with lib;
77
{
8-
options = {
9-
host.btrfs.enable = mkEnableOption "BTRFS partitioning";
8+
options.host.btrfs = {
9+
enable = mkEnableOption "BTRFS partitioning";
1010
};
1111

1212
config = mkIf cfg.enable {

modules/catt.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ let
1010
in
1111
with lib;
1212
{
13-
options = {
14-
host.catt.enable = mkEnableOption "Cast All The Things - Chromecast";
13+
options.host.catt = {
14+
enable = mkEnableOption "Cast All The Things - Chromecast";
1515
};
1616

1717
config = mkIf cfg.enable {

0 commit comments

Comments
 (0)