diff options
| author | Miguel <m.i@gmx.at> | 2021-11-21 03:12:12 +0100 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2021-11-21 03:12:12 +0100 |
| commit | 267178be9f7b8893f769d7189b69fa586b1016ec (patch) | |
| tree | 887aad254efadad8cc0d796c2792856083604bda | |
| parent | a7e171392f9ca073e1cb33f4c8d049262f25981e (diff) | |
cabal build via nix
| -rw-r--r-- | nix/nixops/aquarius/configuration.nix | 143 | ||||
| -rw-r--r-- | nix/nixops/aquarius/hardware-configuration.nix | 23 | ||||
| -rw-r--r-- | nix/nixops/comet/configuration.nix | 9 | ||||
| -rw-r--r-- | nix/nixops/nixops.nix | 5 | ||||
| -rw-r--r-- | nix/shell.nix | 2 |
5 files changed, 181 insertions, 1 deletions
diff --git a/nix/nixops/aquarius/configuration.nix b/nix/nixops/aquarius/configuration.nix new file mode 100644 index 0000000..5034026 --- /dev/null +++ b/nix/nixops/aquarius/configuration.nix @@ -0,0 +1,143 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: + +let + my_ssh_pub_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCpDKWgowf2Gl83b7LsLzwpeKteLWeEE+B3ukE23XAiPmrYnD552ufUnYmid4yItWhNRY4SVsLMCfrdQj8+wftVHNXwx+Y559djAYjkm7qmtBFTvUNPSgtHkX4eoLA79nCPXzd69SS3qkqM2oLGaNKJV9lqxUcaTo0KzKOy5wy7oxQau3w5zCN/kHtxU2ktXGKB6oGocfLi87jefelmoruxo604itpduq78cAhd5fcZy/uZLzNTWf1GdLuqy7ep68txfeRknJ3TKpbaAk+YOlv4AvA23nD7V1GAn757fwv6JpiGe6/VvzkrR8YFLA8sA3kC7Ev8QD1dAkK9S0jMuLzRdAtMWezr7SXNHVEFZ1MLXAbECVkqXOkM0toK8F5ulMfY5E40RWKkawZOr6iB+tHa199WphSgjhtm9frywBMBE/3J5i4purOhZHemmmxJyv4fmSKW42toyc+d6lj0fWBFo3QYWSZPOIpsYhAo4jRw+LHlYwJr7bNIPxKEjutSM5sbacM2Om0GYU+SfHnX4+P5GYaSoFY5SfsjWCpSaK98ngKuKHlBuK2oQczhmFJAFQsBQinpoTF63qfzDpUyfmquvOaDtV9GVMn3AsZemVS+yVXWHHT4ZdXYvSsbgujlM/bUyH/eGLBQnkWBU74W2OxusyFkyp8k7zLwxgj0/hfWew== Miguel_User@DESKTOP-4NH8M69"; + myNixCabal = import ~/nix/cabal/default.nix; +in +{ + imports = [ ./hardware-configuration.nix ]; + + environment.systemPackages = [ myNixCabal ]; + + # Use the GRUB 2 boot loader. + boot.loader.grub.enable = true; + boot.loader.grub.version = 2; + # boot.loader.grub.efiSupport = true; + # boot.loader.grub.efiInstallAsRemovable = true; + # boot.loader.efi.efiSysMountPoint = "/boot/efi"; + # Define on which hard drive you want to install Grub. + boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only + + # USERS / GROUPS / SSH + services.openssh = { + enable = true; + permitRootLogin = "prohibit-password"; + passwordAuthentication = false; + }; + + users.mutableUsers = false; + + users.users.miguel = { + isNormalUser = true; + home = "/home/miguel"; + description = "Miguel"; + extraGroups = [ "wheel" ]; + openssh.authorizedKeys.keys = [ my_ssh_pub_key ]; + uid = 1000; + }; + + security.sudo.wheelNeedsPassword = false; + + users.extraUsers.root.openssh.authorizedKeys.keys = [ my_ssh_pub_key ]; + + + # networking.hostName = "nixos"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Set your time zone. + # time.timeZone = "Europe/Amsterdam"; + + # The global useDHCP flag is deprecated, therefore explicitly set to false here. + # Per-interface useDHCP will be mandatory in the future, so this generated config + # replicates the default behaviour. + networking.useDHCP = false; + networking.interfaces.ens3.useDHCP = false; + networking.interfaces.ens3.ipv6.addresses = [ { "address" = "2a01:4f8:121:4322::4"; + "prefixLength" = 64; + } + ]; + networking.defaultGateway6 = { address = "fe80::1"; interface = "ens3"; }; + + networking.interfaces.ens6.useDHCP = true; + + +services.nginx = { + enable = true; + }; + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Select internationalisation properties. + # i18n.defaultLocale = "en_US.UTF-8"; + # console = { + # font = "Lat2-Terminus16"; + # keyMap = "us"; + # }; + + # Enable the X11 windowing system. + # services.xserver.enable = true; + + + + + # Configure keymap in X11 + # services.xserver.layout = "us"; + # services.xserver.xkbOptions = "eurosign:e"; + + # Enable CUPS to print documents. + # services.printing.enable = true; + + # Enable sound. + # sound.enable = true; + # hardware.pulseaudio.enable = true; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + # users.users.jane = { + # isNormalUser = true; + # extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + # }; + + # List packages installed in system profile. To search, run: + # $ nix search wget + # environment.systemPackages = with pkgs; [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget + # firefox + # ]; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + networking.firewall.enable = true; + networking.firewall.allowedTCPPorts = [ 80 443 ]; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "21.05"; # Did you read the comment? + +} + diff --git a/nix/nixops/aquarius/hardware-configuration.nix b/nix/nixops/aquarius/hardware-configuration.nix new file mode 100644 index 0000000..b3ad84c --- /dev/null +++ b/nix/nixops/aquarius/hardware-configuration.nix @@ -0,0 +1,23 @@ +# 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 = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/0444241a-463d-4506-b0fe-e78d56b4e80f"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + +} diff --git a/nix/nixops/comet/configuration.nix b/nix/nixops/comet/configuration.nix index 78ceaa6..35d573b 100644 --- a/nix/nixops/comet/configuration.nix +++ b/nix/nixops/comet/configuration.nix @@ -98,9 +98,11 @@ in services.ejabberd.configFile = "/etc/ejabberd.yaml"; # GITOLITE + # https://gitolite.com/gitolite/list-non-core.html services.gitolite.enable = true; services.gitolite.extraGitoliteRc = "$RC{UMASK} = 0027; push( @{$RC{ENABLE}}, 'D' ); + push( @{$RC{ENABLE}}, 'readme' ); "; services.gitolite.adminPubkey = my_ssh_pub_key; @@ -142,6 +144,12 @@ in root = "/var/www/comet.softwarefools.com"; }; + services.nginx.virtualHosts."aquarius.softwarefools.com" = { +# forceSSL = true; +# enableACME = true; + locations."/" = { proxyPass = "http://192.168.122.72/"; }; + }; + # ICINGAWEB2 services.icingaweb2.enable = true; services.icingaweb2.modules.monitoring.enable = false; @@ -202,6 +210,7 @@ in } ]; networking.defaultGateway6 = { address = "fe80::1"; interface = "ens3"; }; + networking.interfaces.ens6.useDHCP = true; # Configure network proxy if necessary # networking.proxy.default = "http://user:password@proxy:port/"; diff --git a/nix/nixops/nixops.nix b/nix/nixops/nixops.nix index 1bf10ba..f6d67a0 100644 --- a/nix/nixops/nixops.nix +++ b/nix/nixops/nixops.nix @@ -2,6 +2,11 @@ network.description = "My first NixOS cluster"; network.enableRollback = true; + aquarius = { + imports = [ ./aquarius/configuration.nix ]; + deployment.targetHost = "aquarius"; + }; + comet = { imports = [ ./comet/configuration.nix ]; deployment.targetHost = "comet.softwarefools.com"; diff --git a/nix/shell.nix b/nix/shell.nix index b1b4b16..6318285 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -2,5 +2,5 @@ with pkgs; mkShell { # nativeBuildInputs is usually what you want -- tools you need to run - nativeBuildInputs = [ nixops nixos-generators ]; + nativeBuildInputs = [ nixopsUnstable nixos-generators ]; } |
