commit d7ac8263bfc56f46a964be9dcc3be702948ba876 Author: LordGrimmauld Date: Sat Mar 16 10:07:36 2024 +0100 add localisation as a test diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..e2d06b5 --- /dev/null +++ b/default.nix @@ -0,0 +1,21 @@ +{ config, lib, pkgs, ... }: +with lib; +let + cfg = config.grimmShared; +in { + options.grimmShared = { + enable = mkEnableOption "grimm-shared-modules"; + + enableLocale = mkOption { + type = types.bool; + default = true; + description = "Sets german units but english language"; + }; + }; + + config = with cfg; lib.mkIf (enable) { + imports = [] + ++ optionals cfg.enableLocale [./modules/localisation.nix] + ; + }; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..e3fa255 --- /dev/null +++ b/flake.lock @@ -0,0 +1,77 @@ +{ + "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1710451336, + "narHash": "sha256-pP86Pcfu3BrAvRO7R64x7hs+GaQrjFes+mEPowCfkxY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d691274a972b3165335d261cc4671335f5c67de9", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs", + "utils": "utils" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..1af31cf --- /dev/null +++ b/flake.nix @@ -0,0 +1,28 @@ +{ + description = "A library flake for shared modules accross my installations"; + + inputs = { + flake-compat = { + url = "github:edolstra/flake-compat"; + flake = false; + }; + utils.url = "github:numtide/flake-utils"; + nixpkgs.url = "flake:nixpkgs/nixos-unstable"; + }; + + outputs = { self, utils, nixpkgs, ... }: let + lib = nixpkgs.lib; + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + assembledModule = import ./.; + in { + nixosModules = rec { + grimmShared = assembledModule; + default = assembledModule; + }; + # nixosModule = self.nixosModules.default; # compatibility + }; +} + + + diff --git a/modules/localisation.nix b/modules/localisation.nix new file mode 100644 index 0000000..1ad7e81 --- /dev/null +++ b/modules/localisation.nix @@ -0,0 +1,25 @@ +{ + time.timeZone = "Europe/Berlin"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "de_DE.UTF-8"; + LC_IDENTIFICATION = "de_DE.UTF-8"; + LC_MEASUREMENT = "de_DE.UTF-8"; + LC_MONETARY = "de_DE.UTF-8"; + LC_NAME = "de_DE.UTF-8"; + LC_NUMERIC = "de_DE.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TELEPHONE = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + }; + + console.keyMap = "de"; + + services.xserver.xkb = { + layout = "de"; + variant = ""; + }; +}