diff --git a/hosts/MaxNixosLaptop/configuration.nix b/hosts/MaxNixosLaptop/configuration.nix index db17799..4d4d888 100644 --- a/hosts/MaxNixosLaptop/configuration.nix +++ b/hosts/MaxNixosLaptop/configuration.nix @@ -34,39 +34,9 @@ networking.hostName = "MaxNixosLaptop"; # Define your hostname. - # Set your time zone. - time.timeZone = "Europe/Berlin"; - # NIXOS nix.settings.experimental-features = ["nix-command" "flakes"]; - # Enable CUPS to print documents. - services.printing = { - enable = true; - drivers = [pkgs.samsung-unified-linux-driver]; - }; - services.avahi = { - enable = true; - nssmdns = true; - openFirewall = true; - }; - hardware.printers = { - ensurePrinters = [ - { - name = "Samsung_ML-1630W_Series"; - location = "luhbots"; - deviceUri = "dnssd://Samsung%20ML-1630W%20Series%20(SEC00159937E684)._pdl-datastream._tcp.local/"; - model = "samsung/ML-1630W.ppd"; - ppdOptions = { - PageSize = "A4"; - }; - } - ]; - }; - - # 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.max = { isNormalUser = true; diff --git a/modules/nixos/cups.nix b/modules/nixos/cups.nix new file mode 100644 index 0000000..aee18ba --- /dev/null +++ b/modules/nixos/cups.nix @@ -0,0 +1,47 @@ +{ + lib, + config, + pkgs, + ... +}: let + cfg = config.myConfig.cups; +in { + options.myConfig.cups = { + enable = lib.mkEnableOption "printing"; + }; + + config = { + # Enable CUPS to print documents. + services.printing = { + enable = true; + drivers = [pkgs.samsung-unified-linux-driver]; + }; + services.avahi = { + enable = true; + nssmdns = true; + openFirewall = true; + }; + hardware.printers = { + ensurePrinters = [ + { + name = "Samsung_ML-1630W_Series"; + location = "luhbots"; + deviceUri = "dnssd://Samsung%20ML-1630W%20Series%20(SEC00159937E684)._pdl-datastream._tcp.local/"; + model = "samsung/ML-1630W.ppd"; + ppdOptions = { + PageSize = "A4"; + }; + } + { + name = "Brother_HL-L3210CW_series"; + location = "Max Zimmer"; + deviceUri = "dnssd://Brother%20HL-L3210CW%20series._ipp._tcp.local/?uuid=e3248000-80ce-11db-8000-900f0c617136"; + model = "drv:///sample.drv/generic.ppd"; + ppdOptions = { + PageSize = "A4"; + }; + } + ]; + }; + }; +} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index e9fcc95..b2a154a 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -5,7 +5,7 @@ }: let cfg = config.myConfig; in { - imports = [./bootloader.nix ./locale.nix ./greetd.nix ./rebuild.nix ./sops.nix ./sway.nix ./wifi.nix ./music.nix]; + imports = [./bootloader.nix ./locale.nix ./greetd.nix ./rebuild.nix ./sops.nix ./sway.nix ./wifi.nix ./music.nix ./cups.nix]; options.myConfig = { enable = lib.mkEnableOption "my custom config"; @@ -21,6 +21,7 @@ in { greetd.enable = lib.mkIf cfg.desktop true; sway.enable = lib.mkIf cfg.desktop true; music.enable = lib.mkIf cfg.desktop true; + cups.enable = lib.mkIf cfg.desktop true; wifi.tray = lib.mkIf cfg.desktop true; sway.laptop = lib.mkIf cfg.laptop true; diff --git a/modules/nixos/locale.nix b/modules/nixos/locale.nix index cb025bf..22b2ef2 100644 --- a/modules/nixos/locale.nix +++ b/modules/nixos/locale.nix @@ -10,6 +10,9 @@ in { }; config = lib.mkIf cfg.enable { + # Set your time zone. + time.timeZone = "Europe/Berlin"; + # Select internationalisation properties. i18n.defaultLocale = "en_US.UTF-8";