diff --git a/flake.lock b/flake.lock index 0b62f80..8340071 100644 --- a/flake.lock +++ b/flake.lock @@ -23,9 +23,7 @@ "bonfire": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": [ - "nixpkgs" - ] + "nixpkgs": "nixpkgs" }, "locked": { "lastModified": 1664777933, @@ -72,6 +70,22 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1664753041, + "narHash": "sha256-0ogaD8PaGHluARFeupofvk1Nq9gpVeZdlFM0Kcwguys=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a62844b302507c7531ad68a86cb7aa54704c9cb4", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1659522808, "narHash": "sha256-HBcM19nGhI3IWwPNVlYb0MZ8VW6iKp4JbAVkeIHVykc=", @@ -92,7 +106,7 @@ "agenix": "agenix", "bonfire": "bonfire", "hardware": "hardware", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" } } }, diff --git a/flake.nix b/flake.nix index 00d5c4d..0d1cbf1 100644 --- a/flake.nix +++ b/flake.nix @@ -6,7 +6,7 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; hardware.url = "github:nixos/nixos-hardware"; bonfire.url = "github:bonfire-networks/bonfire-app"; - bonfire.inputs.nixpkgs.follows = "nixpkgs"; + # bonfire.inputs.nixpkgs.follows = "nixpkgs"; agenix.url = "github:ryantm/agenix"; agenix.inputs.nixpkgs.follows = "nixpkgs"; }; @@ -14,11 +14,11 @@ outputs = { nixpkgs, bonfire, agenix, ... }@inputs: let forAllSystems = nixpkgs.lib.genAttrs [ - "aarch64-linux" - "i686-linux" + # "aarch64-linux" + # "i686-linux" "x86_64-linux" - "aarch64-darwin" - "x86_64-darwin" + # "aarch64-darwin" + # "x86_64-darwin" ]; in rec { @@ -34,7 +34,7 @@ # Devshell for bootstrapping # Acessible through 'nix develop' or 'nix-shell' (legacy) devShells = forAllSystems (system: { - default = legacyPackages.${system}.callPackage ./shell.nix { agenix = agenix; }; + default = legacyPackages.${system}.callPackage ./shell.nix { agenix = inputs.agenix; }; }); # This instantiates nixpkgs for each system listed above @@ -61,50 +61,8 @@ modules = (builtins.attrValues nixosModules) ++ [ # > Our main nixos configuration file < ./nixos/configuration.nix - bonfire.nixosModules.bonfire - agenix.nixosModule.age - ]; - }; - test = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ./nixos/configuration.nix - bonfire.nixosModules.bonfire - ({ pkgs, ... }: { - boot.isContainer = true; - networking.firewall.allowedTCPPorts = [ 80 ]; - services.nginx = { - enable = true; - virtualHosts."bonfire.lan".locations."/".proxyPass = "http://localhost:4000"; - }; - services.bonfire = { - # you will need to expose bonfire with a reverse proxy, for example caddy - port = 4000; - package = pkgs.elixirBonfire; - dbName = "bonfire"; - # the environment should contain a minimum of - # SECRET_KEY_BASE - # SIGNING_SALT - # ENCRYPTION_SALT - # RELEASE_COOKIE - # have a look into nix/module.nix for more details - # the way to deploy secrets is beyond this readme, but I would recommend agenix - environmentFile = "/run/secrets/bonfireEnv"; - dbSocketDir = "/var/run/postgresql"; - }; - - # this is uniquely for database backup purposes - # replace myBackupUserName with the user name that will do the backups - # if you want to do backups differently, feel free to remove this part of the config - # services.postgresql = { - # enable = true; - # ensureDatabases = [ "bonfire" ]; - # ensureUsers = [{ - # name = "bonfire"; - # ensurePermissions = { "DATABASE bonfire" = "ALL PRIVILEGES"; }; - # }]; - # }; - }) + # bonfire.nixosModule + agenix.nixosModule ]; }; }; diff --git a/nixos/configuration.nix b/nixos/configuration.nix index e4ebbec..cd81df9 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -7,8 +7,8 @@ # Import your generated (nixos-generate-config) hardware configuration ./hardware-configuration.nix ./vault-warden.nix - ./book-stack.nix - ./bonfire.nix + # ./book-stack.nix + # ./bonfire.nix ./mumble.nix ]; @@ -29,10 +29,11 @@ }; }; - environment.systemPackages = [ + environment.systemPackages = with pkgs; [ git vim ]; + networking.firewall.allowedTCPPorts = [ 80 443]; # Remove if you wish to disable unfree packages for your system nixpkgs.config.allowUnfree = true; diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix index dd00939..9c08ac6 100644 --- a/nixos/hardware-configuration.nix +++ b/nixos/hardware-configuration.nix @@ -1,10 +1,39 @@ -# This is just an example, you should generate yours with nixos-generate-config and put it in here. +# 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, ... }: + { - fileSystems."/" = { - device = "/dev/sda1"; - fsType = "ext4"; + imports = + [ (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "ata_piix" "virtio_pci" "floppy" "sr_mod" "virtio_blk" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + boot.loader.grub = { + enable = true; + version = 2; + device = "/dev/vda"; }; - # Set your system kind (needed for flakes) + fileSystems."/" = + { device = "/dev/disk/by-uuid/7c560634-d545-41cc-b375-42ce3037fd73"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + # 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.ens3.useDHCP = lib.mkDefault true; + + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + nixpkgs.hostPlatform = "x86_64-linux"; } diff --git a/nixos/mumble.nix b/nixos/mumble.nix index 893c7ce..0a1a5fa 100644 --- a/nixos/mumble.nix +++ b/nixos/mumble.nix @@ -2,7 +2,7 @@ { services.murmur = { enable = true; - hostname = "talk.sincerity.network"; + hostName = "talk.sincerity.network"; registerHostname = "talk.sincerity.network"; registerUrl = "talk.sincerity.network"; registerName = "Sincerity Network Mumble"; @@ -10,9 +10,13 @@ services.nginx = { enable = true; - useACME = true; - forceSSL = true; - virtualHosts."talk.sincerity.network".proxyPass = "http://localhost:64738/"; + virtualHosts."talk.sincerity.network" = { + locations."/".proxyPass = "http://localhost:64738/"; + enableACME = true; + forceSSL = true; + }; }; + security.acme.defaults.email = "infra@sincerity.network"; + security.acme.acceptTerms = true; } diff --git a/pkgs/default.nix b/pkgs/default.nix index 244ae74..ec21ecf 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -2,5 +2,5 @@ # These are similar to nixpkgs packages { inputs, pkgs }: { # example = pkgs.callPackage ./example { }; - elixirBonfire = inputs.bonfire.defaultPackage.x86_64-linux; + # elixirBonfire = inputs.bonfire.packages.x86_64-linux.default; }