|
28 | 28 | lib.genAttrs systems
|
29 | 29 | (system: f system (nixpkgs.legacyPackages.${system}));
|
30 | 30 | in {
|
31 |
| - packages."x86_64-linux".rustnixos = pkgs.callPackage ./nix/rustnixos.package.nix {}; |
32 |
| - packages."x86_64-linux".migration-data = pkgs.callPackage ./nix/migration-data.package.nix {}; |
33 |
| -# packages."x86_64-linux".postgresql-devVM = |
34 |
| -# self.nixosConfigurations.postgresql-devVM.config.system.build.vm; |
| 31 | + packages."x86_64-linux".rustnixos = |
| 32 | + pkgs.callPackage ./nix/rustnixos.package.nix { }; |
| 33 | + packages."x86_64-linux".migration-data = |
| 34 | + pkgs.callPackage ./nix/migration-data.package.nix { }; |
35 | 35 |
|
36 | 36 | nixosModules.rustnixos = import ./module.nix;
|
37 | 37 | nixosModules.default = import ./module.nix;
|
38 | 38 | nixosModules.caddy = import ./nix/caddy.module.nix;
|
39 |
| - nixosModules.postgresql-dev = import ./nixos-modules/postgresql-dev.nix; |
| 39 | + nixosModules.db-dev = import ./nix/postgresql-dev.nix; |
40 | 40 |
|
| 41 | + # Run database+migration only in container for dev |
| 42 | + nixosConfigurations.db-dev = nixpkgs.lib.nixosSystem { |
| 43 | + inherit system; |
| 44 | + specialArgs = attrs // { |
| 45 | + inherit (self.packages.${system}) migration-data; |
| 46 | + inherit system; |
| 47 | + }; |
| 48 | + |
| 49 | + modules = [ |
| 50 | + self.nixosModules.db-dev |
| 51 | + ({ pkgs, config, ... }: { |
| 52 | + boot.isContainer = true; |
| 53 | + system.stateVersion = "23.11"; |
| 54 | + # firewall seem to be enabled by default |
| 55 | + networking.firewall.enable = false; |
| 56 | + }) |
| 57 | + ]; |
| 58 | + }; |
41 | 59 |
|
42 | 60 | # Run whole setup in container
|
43 |
| - nixosConfigurations.mycontainer = nixpkgs.lib.nixosSystem { |
| 61 | + nixosConfigurations.all = nixpkgs.lib.nixosSystem { |
44 | 62 | inherit system;
|
45 |
| - specialArgs = attrs // { inherit (self.packages.${system}) migration-data; inherit system;}; |
| 63 | + specialArgs = attrs // { |
| 64 | + inherit (self.packages.${system}) migration-data; |
| 65 | + inherit system; |
| 66 | + }; |
46 | 67 | modules = [
|
47 | 68 | self.nixosModules.rustnixos
|
48 | 69 | self.nixosModules.caddy
|
|
53 | 74 | })
|
54 | 75 | ];
|
55 | 76 | };
|
56 |
| - # Run database setup in container |
57 |
| - nixosConfigurations.postgresql-devVM = nixpkgs.lib.nixosSystem { |
58 |
| - inherit system; |
59 |
| - specialArgs = attrs // { inherit (self.packages.${system}) migration-data; inherit system;}; |
60 |
| - |
61 |
| - modules = [ |
62 |
| - self.nixosModules.postgresql-dev |
63 |
| - ({ pkgs, config, ... }: { |
64 |
| - # Only allow this to boot as a container |
65 |
| - boot.isContainer = true; |
66 |
| - # Make VM output to the terminal instead of a separate window |
67 |
| - virtualisation.vmVariant.virtualisation.graphics = false; |
68 |
| - system.stateVersion = "23.11"; |
69 |
| - }) |
70 |
| - ]; |
| 77 | + #----------------------------------------------------------- |
| 78 | + # The following line names the configuration as hetzner-cloud |
| 79 | + # This name will be referenced when nixos-remote is run |
| 80 | + #----------------------------------------------------------- |
| 81 | + nixosConfigurations.hetzner-cloud = nixpkgs.lib.nixosSystem { |
| 82 | + inherit system; |
| 83 | + specialArgs = attrs // { |
| 84 | + inherit (self.packages.${system}) migration-data; |
| 85 | + inherit system; |
| 86 | + }; |
| 87 | + modules = [ |
| 88 | + ({ modulesPath, ... }: { |
| 89 | + imports = [ |
| 90 | + (modulesPath + "/installer/scan/not-detected.nix") |
| 91 | + (modulesPath + "/profiles/qemu-guest.nix") |
| 92 | + disko.nixosModules.disko |
| 93 | + agenix.nixosModules.default |
| 94 | + self.nixosModules.rustnixos |
| 95 | + self.nixosModules.caddy |
| 96 | + ]; |
| 97 | + disko.devices = |
| 98 | + import ./nix/disk-config.disko.nix { lib = nixpkgs.lib; }; |
| 99 | + age.secrets.secret1.file = ./secrets/secret1.age; |
| 100 | + boot.loader.grub = { |
| 101 | + devices = [ "/dev/sda" ]; |
| 102 | + efiSupport = true; |
| 103 | + efiInstallAsRemovable = true; |
71 | 104 | };
|
72 |
| - |
73 |
| - #----------------------------------------------------------- |
74 |
| - # The following line names the configuration as hetzner-cloud |
75 |
| - # This name will be referenced when nixos-remote is run |
76 |
| - #----------------------------------------------------------- |
77 |
| - nixosConfigurations.hetzner-cloud = nixpkgs.lib.nixosSystem { |
78 |
| - inherit system; |
79 |
| - specialArgs = attrs // { inherit (self.packages.${system}) migration-data; inherit system;}; |
80 |
| - modules = [ |
81 |
| - ({modulesPath, ... }: { |
82 |
| - imports = [ |
83 |
| - (modulesPath + "/installer/scan/not-detected.nix") |
84 |
| - (modulesPath + "/profiles/qemu-guest.nix") |
85 |
| - disko.nixosModules.disko |
86 |
| - agenix.nixosModules.default |
87 |
| - self.nixosModules.rustnixos |
88 |
| - self.nixosModules.caddy |
89 |
| - ]; |
90 |
| - disko.devices = import ./nix/disk-config.disko.nix { |
91 |
| - lib = nixpkgs.lib; |
92 |
| - }; |
93 |
| - age.secrets.secret1.file = ./secrets/secret1.age; |
94 |
| - boot.loader.grub = { |
95 |
| - devices = [ "/dev/sda" ]; |
96 |
| - efiSupport = true; |
97 |
| - efiInstallAsRemovable = true; |
98 |
| - }; |
99 |
| - services.openssh.enable = true; |
100 |
| - system.stateVersion = "23.11"; |
101 |
| - #------------------------------------------------------- |
102 |
| - # Change the line below replacing <insert your key here> |
103 |
| - # with your own ssh public key |
104 |
| - #------------------------------------------------------- |
105 |
| - users.users.root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJV/MZW0GP6guibA1rNwPwK6Q0WGg1of6MQRMpeqiUR8 mahene" ]; |
106 |
| - }) |
| 105 | + services.openssh.enable = true; |
| 106 | + system.stateVersion = "23.11"; |
| 107 | + #------------------------------------------------------- |
| 108 | + # Change the line below replacing <insert your key here> |
| 109 | + # with your own ssh public key |
| 110 | + #------------------------------------------------------- |
| 111 | + users.users.root.openssh.authorizedKeys.keys = [ |
| 112 | + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJV/MZW0GP6guibA1rNwPwK6Q0WGg1of6MQRMpeqiUR8 mahene" |
107 | 113 | ];
|
108 |
| - }; |
| 114 | + }) |
| 115 | + ]; |
| 116 | + }; |
109 | 117 | };
|
110 |
| -# // dream2nix.lib.makeFlakeOutputs { |
111 |
| -# inherit systems; |
112 |
| -# config.projectRoot = ./.; |
113 |
| -# source = |
114 |
| -# lib.sourceFilesBySuffices ./. [ ".rs" "Cargo.toml" "Cargo.lock" ]; |
115 |
| -# projects."rust-nixos" = { |
116 |
| -# name = "2rust-nixos"; |
117 |
| -# translator = "cargo-lock"; |
118 |
| -# }; |
119 |
| -# }; |
| 118 | + # // dream2nix.lib.makeFlakeOutputs { |
| 119 | + # inherit systems; |
| 120 | + # config.projectRoot = ./.; |
| 121 | + # source = |
| 122 | + # lib.sourceFilesBySuffices ./. [ ".rs" "Cargo.toml" "Cargo.lock" ]; |
| 123 | + # projects."rust-nixos" = { |
| 124 | + # name = "2rust-nixos"; |
| 125 | + # translator = "cargo-lock"; |
| 126 | + # }; |
| 127 | + # }; |
120 | 128 | }
|
0 commit comments