From 38ba8be512b8dbb8838fbca9865b2a8d24f6bee1 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Mon, 10 Jan 2022 00:42:01 +0100 Subject: add abbenay (desktop config) --- common/cachix.nix | 13 +++++++++ common/cachix/nix-community.nix | 11 ++++++++ common/cachix/veloren-nix.nix | 12 ++++++++ common/common.nix | 16 +++++++++++ common/default.nix | 43 ---------------------------- common/desktop.nix | 62 +++++++++++++++++++++++++++++++++++++++++ common/headless.nix | 31 +++++++++++++++++++++ 7 files changed, 145 insertions(+), 43 deletions(-) create mode 100644 common/cachix.nix create mode 100644 common/cachix/nix-community.nix create mode 100644 common/cachix/veloren-nix.nix create mode 100644 common/common.nix delete mode 100644 common/default.nix create mode 100644 common/desktop.nix create mode 100644 common/headless.nix (limited to 'common') diff --git a/common/cachix.nix b/common/cachix.nix new file mode 100644 index 0000000..88b2f08 --- /dev/null +++ b/common/cachix.nix @@ -0,0 +1,13 @@ + +# WARN: this file will get overwritten by $ cachix use +{ pkgs, lib, ... }: + +let + folder = ./cachix; + toImport = name: value: folder + ("/" + name); + filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key; + imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder)); +in { + inherit imports; + nix.binaryCaches = ["https://cache.nixos.org/"]; +} diff --git a/common/cachix/nix-community.nix b/common/cachix/nix-community.nix new file mode 100644 index 0000000..427a518 --- /dev/null +++ b/common/cachix/nix-community.nix @@ -0,0 +1,11 @@ + +{ + nix = { + binaryCaches = [ + "https://nix-community.cachix.org" + ]; + binaryCachePublicKeys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + }; +} diff --git a/common/cachix/veloren-nix.nix b/common/cachix/veloren-nix.nix new file mode 100644 index 0000000..37fb947 --- /dev/null +++ b/common/cachix/veloren-nix.nix @@ -0,0 +1,12 @@ + +{ + nix = { + binaryCaches = [ + "https://veloren-nix.cachix.org" + ]; + binaryCachePublicKeys = [ + "veloren-nix.cachix.org-1:zokfKJqVsNV6kI/oJdLF6TYBdNPYGSb+diMVQPn/5Rc=" + ]; + }; +} + \ No newline at end of file diff --git a/common/common.nix b/common/common.nix new file mode 100644 index 0000000..b0aeb26 --- /dev/null +++ b/common/common.nix @@ -0,0 +1,16 @@ +{ config, lib, pkgs, ... }: + +{ + + services.journald.extraConfig = "MaxRetentionSec=48h"; + + + i18n.defaultLocale = "en_US.UTF-8"; + time.timeZone = "Europe/Amsterdam"; + + environment.systemPackages = with pkgs; [ + wget vim htop dnsutils inetutils iftop manpages + ]; + + +} diff --git a/common/default.nix b/common/default.nix deleted file mode 100644 index 1b87571..0000000 --- a/common/default.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - sources = import ../nix/sources.nix; -in { - imports = [ - ../modules - ]; - - networking.domain = lib.mkDefault "stuebinm.eu"; - - services.journald.extraConfig = "MaxRetentionSec=48h"; - nix.gc = { - automatic = lib.mkDefault true; - options = lib.mkDefault "--delete-older-than 1w"; - }; - - - i18n.defaultLocale = "en_US.UTF-8"; - time.timeZone = "Europe/Amsterdam"; - - environment.systemPackages = with pkgs; [ - wget vim htop dnsutils inetutils iftop manpages - ]; - - users.users.root.openssh.authorizedKeys.keys = [ - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCTeuG1alKNNqoT2d5nUAlH0Otsk0NHM7nmkYC5Yfk8qcLsgY4v2dXlyrMzieajYgDjndEApgO3/S/V0EQGhvHc0UugC6LU84jHPwsgYVABRmFS74v/ww8NigaNIAevwWl+DxlnK4nnWdB1lo4xS69ooQdvoAjbubk16dP04LsAbH8Z+3cPB5WKAaayNx62DUwObzDSpztqCagCZzlqpwKG1UGJngrqEhk7B5Q0v9iCk91gqVkLSPllsB00+bqIimgkMVIZnoLLh7pcEgOvbG0yP2EG3ttDNN3jPpqE6mu+znfLq+ua/MwJy5hjmY5R54yPlcvFdsIU34jrdMCDvWqpV49VrLwVvkFN3lRZln/9eifkXXJciP4Ber3xEl8JltysV1PE5iJunWfbcOy0fwsYvBChDeyR5G3CLG2c25jKL9f1Iq95QBBMVYgIxq/dpGy0tjB+24w1JzsorvElsmz5etXLXCydLP07ic9PfSu1Wmwu7F0tweIk52x97sra6ePhtY+TTRffjjDz0DEho1bWDfrPV0xfPPAWXWTKYisVO4VVmMQsJbtXrfxUJbappM5vIXcJ+2JpT2Oh7Kiy3rjm+pd7rukgoCp7yN5z8v+2vuOfHqBuKUwlaRg/XNMyPrbnGGzVR1xzUuhwdOnjAyMmAr95Ne9hRBPwfVo2NR/ZZw==" - ]; - - services.openssh = { - enable = true; - permitRootLogin = "prohibit-password"; - passwordAuthentication = false; - }; - - security.sudo.enable = false; - - security.acme = { - acceptTerms = true; - email = "stuebinm@disroot.org"; - }; - -} diff --git a/common/desktop.nix b/common/desktop.nix new file mode 100644 index 0000000..eb94b6e --- /dev/null +++ b/common/desktop.nix @@ -0,0 +1,62 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./common.nix + ./cachix.nix + ]; + + nix.package = pkgs.nix_2_4; + nix.extraOptions = '' + netrc-file = /home/stuebinm/Dokumente/.netrc + experimental-features = nix-command flakes + ''; + + virtualisation.podman.enable = true; + + # Select internationalisation properties. + console = { + font = "Lat2-Terminus16"; + keyMap = "de"; + }; + + # Enable CUPS to print documents. + services.printing = { + enable = true; + drivers = [ pkgs.epson-escpr2 pkgs.epson-escpr ]; + }; + + + # Enable sound. + sound.enable = true; + hardware.pulseaudio.enable = true; + + # Enable the X11 windowing system. + services.xserver.enable = true; + services.xserver.layout = "de"; + services.xserver.xkbOptions = "eurosign:e,caps:escape"; + + users.mutableUsers = false; + users.defaultUserShell = pkgs.fish; + users.users.stuebinm = { + isNormalUser = true; + extraGroups = [ "docker" "wheel" ]; # Enable ‘sudo’ for the user. + home = "/home/stuebinm"; + hashedPassword = "$6$IULsCnY7HjDHAJWs$05DYuwXsfWWKj6m3KTWCPp5k9HuQikIamNBzn2GihMG8oeEf5c8YkXlwuO6uTnX8ZFmyAQdhXfO5yYNEM/YTm0"; + useDefaultShell = true; + }; + + + services.syncthing = { + enable = true; + user = "stuebinm"; + guiAddress = "syncthing.localhost:3000"; + dataDir = "/home/stuebinm/syncthing"; + configDir = "/home/stuebinm/syncthing/.config/syncthing"; + }; + + networking.hosts = { + "127.0.0.1" = [ "syncthing.localhost" ]; + }; + +} diff --git a/common/headless.nix b/common/headless.nix new file mode 100644 index 0000000..6c4127e --- /dev/null +++ b/common/headless.nix @@ -0,0 +1,31 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ ./common.nix ]; + + networking.domain = lib.mkDefault "stuebinm.eu"; + + nix.gc = { + automatic = lib.mkDefault true; + options = lib.mkDefault "--delete-older-than 1w"; + }; + + users.users.root.openssh.authorizedKeys.keys = [ + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCTeuG1alKNNqoT2d5nUAlH0Otsk0NHM7nmkYC5Yfk8qcLsgY4v2dXlyrMzieajYgDjndEApgO3/S/V0EQGhvHc0UugC6LU84jHPwsgYVABRmFS74v/ww8NigaNIAevwWl+DxlnK4nnWdB1lo4xS69ooQdvoAjbubk16dP04LsAbH8Z+3cPB5WKAaayNx62DUwObzDSpztqCagCZzlqpwKG1UGJngrqEhk7B5Q0v9iCk91gqVkLSPllsB00+bqIimgkMVIZnoLLh7pcEgOvbG0yP2EG3ttDNN3jPpqE6mu+znfLq+ua/MwJy5hjmY5R54yPlcvFdsIU34jrdMCDvWqpV49VrLwVvkFN3lRZln/9eifkXXJciP4Ber3xEl8JltysV1PE5iJunWfbcOy0fwsYvBChDeyR5G3CLG2c25jKL9f1Iq95QBBMVYgIxq/dpGy0tjB+24w1JzsorvElsmz5etXLXCydLP07ic9PfSu1Wmwu7F0tweIk52x97sra6ePhtY+TTRffjjDz0DEho1bWDfrPV0xfPPAWXWTKYisVO4VVmMQsJbtXrfxUJbappM5vIXcJ+2JpT2Oh7Kiy3rjm+pd7rukgoCp7yN5z8v+2vuOfHqBuKUwlaRg/XNMyPrbnGGzVR1xzUuhwdOnjAyMmAr95Ne9hRBPwfVo2NR/ZZw==" + ]; + + services.openssh = { + enable = true; + permitRootLogin = "prohibit-password"; + passwordAuthentication = false; + }; + + security.sudo.enable = false; + + + security.acme = { + acceptTerms = true; + email = "stuebinm@disroot.org"; + }; + +} -- cgit v1.2.3