Skip to content

Commit 61db07c

Browse files
committed
wip
1 parent f16adee commit 61db07c

File tree

9 files changed

+33
-55
lines changed

9 files changed

+33
-55
lines changed

flake.nix

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -74,24 +74,8 @@
7474
};
7575

7676
nixosConfigurations = {
77-
cirno = nixpkgs.lib.nixosSystem {
78-
system = "x86_64-linux";
79-
modules = [
80-
({ ... }: { nixpkgs.overlays = [ overlays.default ]; })
81-
./servers/base.nix
82-
./servers/cirno/configuration.nix
83-
];
84-
specialArgs = inputs // { inherit self; };
85-
};
86-
cs306 = nixpkgs.lib.nixosSystem {
87-
system = "x86_64-linux";
88-
modules = [
89-
({ ... }: { nixpkgs.overlays = [ overlays.default ]; })
90-
./servers/base.nix
91-
./servers/cs306/configuration.nix
92-
];
93-
specialArgs = inputs // { inherit self; };
94-
};
77+
cirno = import ./servers/cirno inputs;
78+
cs306 = import ./servers/cs306 inputs;
9579
};
9680
}
9781
);

packages/imports.nix

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
{ config, pkgs, lib, ... }:
1+
{ ... }:
22

3-
let sources = import <acm-aws/nix/sources.nix> { };
4-
5-
in {
3+
{
64
imports = [
75
./caddy/caddy.nix
86
./sysmet/sysmet.nix
97
./dischord/service.nix
108
./christmasd/service.nix
119
];
12-
13-
nixpkgs.overlays = import <acm-aws/nix/overlays.nix>;
1410
}

servers/base.nix

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
{ config, pkgs, lib, ... }:
1+
{ config, pkgs, lib, self, ... }:
22

3-
let sources = import ../nix/sources.nix;
4-
5-
in {
3+
{
64
imports = [
7-
<acm-aws/packages/imports.nix>
8-
<acm-aws/nix/modules>
5+
(self + "/packages/imports.nix")
6+
(self + "/nix/modules")
97
];
108

119
services.journald = {
@@ -41,5 +39,10 @@ in {
4139
];
4240

4341
# Deploy ./static to all servers.
44-
deployment.staticPaths = [ ../static ];
42+
deployment.staticPaths = [ (self + "/static") ];
43+
44+
# Add the flake's overlays to the system.
45+
nixpkgs.overlays = [
46+
self.overlays.${pkgs.system}.default
47+
];
4548
}

servers/cirno/configuration.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
{ config, lib, pkgs, modulesPath, ... }:
1+
{ config, lib, pkgs, modulesPath, self, ... }:
22

33
{
44
imports = [
55
(modulesPath + "/virtualisation/amazon-image.nix")
6-
<acm-aws/servers/base.nix>
6+
(self + "/servers/base.nix")
77
./services.nix
88
./telemetry.nix
99
];

servers/cirno/default.nix

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
let
2-
sources = import <acm-aws/nix/sources.nix>;
3-
in
1+
{ nixpkgs, ... }@inputs:
42

5-
import "${sources.nixpkgs}/nixos" {
3+
nixpkgs.lib.nixosSystem {
64
system = "x86_64-linux";
7-
configuration = import ./configuration.nix;
5+
modules = [ ./servers/cirno/configuration.nix ];
6+
specialArgs = inputs;
87
}

servers/cirno/main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ resource "aws_instance" "cirno" {
7171
}
7272

7373
module "deployment" {
74-
source = "git::https://github.com/diamondburned/terraform-nixos.git//deploy_nixos?ref=9d26ace355b2ed7d64a253b11ab12395a1395030"
75-
nixos_config = "${path.module}"
74+
source = "github.com/tweag/terraform-nixos//deploy_nixos?ref=646cacb12439ca477c05315a7bfd49e9832bc4e3"
75+
nixos_config = "cirno"
76+
flake = true
7677
target_host = var.host != null ? var.host : aws_instance.cirno.public_ip
7778
ssh_private_key_file = var.ssh_private_key_file
7879
ssh_agent = false

servers/cs306/configuration.nix

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
# Edit this configuration file to define what should be installed on
2-
# your system. Help is available in the configuration.nix(5) man page
3-
# and in the NixOS manual (accessible by running ‘nixos-help’).
4-
5-
{ config, pkgs, lib, ... }:
1+
{ config, pkgs, lib, self, ... }:
62

73
{
8-
imports = [ # Include the results of the hardware scan.
9-
<acm-aws/servers/base.nix>
10-
# <acm-aws/containers/cs306/test.nix>
4+
imports = [
5+
(self + "/servers/base.nix")
116
./hardware-configuration.nix
127
./services.nix
138
./recovery.nix

servers/cs306/default.nix

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
let
2-
sources = import <acm-aws/nix/sources.nix>;
3-
in
1+
{ nixpkgs, ... }@inputs:
42

5-
import "${sources.nixpkgs}/nixos" {
3+
nixpkgs.lib.nixosSystem {
64
system = "x86_64-linux";
7-
configuration = import ./configuration.nix;
5+
modules = [ ./servers/cs306/configuration.nix ];
6+
specialArgs = inputs;
87
}

servers/cs306/main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ variable "host" {
99
}
1010

1111
module "deployment" {
12-
source = "git::https://github.com/diamondburned/terraform-nixos.git//deploy_nixos?ref=9d26ace355b2ed7d64a253b11ab12395a1395030"
13-
nixos_config = "${path.module}"
12+
source = "github.com/tweag/terraform-nixos//deploy_nixos?ref=646cacb12439ca477c05315a7bfd49e9832bc4e3"
13+
nixos_config = "cs306"
14+
flake = true
1415
target_host = "${var.host}"
1516
ssh_private_key_file = var.ssh_private_key_file
1617
ssh_agent = false

0 commit comments

Comments
 (0)