From bc1e1731cfb5e6b41535a581ddb2da850278fb22 Mon Sep 17 00:00:00 2001 From: Fabian Hauser Date: Sat, 26 Nov 2022 10:59:36 +0100 Subject: [PATCH] Add fcc-unlock --- .gitmodules | 3 ++ defaults/hardware/thinkpad-x1-gen9.nix | 9 +++-- fcc-unlock | 1 + flake.lock | 47 +++++++++++++++++++------- flake.nix | 9 +++-- qois-infrastructure | 2 +- 6 files changed, 53 insertions(+), 18 deletions(-) create mode 160000 fcc-unlock diff --git a/.gitmodules b/.gitmodules index ef17d65..eaaa8ce 100644 --- a/.gitmodules +++ b/.gitmodules @@ -6,3 +6,6 @@ path = defaults/threema url = git@github.com:fabianhauser/nixos-config-threema.git branch = main +[submodule "fcc-unlock"] + path = fcc-unlock + url = ./fcc-unlock/ diff --git a/defaults/hardware/thinkpad-x1-gen9.nix b/defaults/hardware/thinkpad-x1-gen9.nix index e6a4b72..c68c72d 100644 --- a/defaults/hardware/thinkpad-x1-gen9.nix +++ b/defaults/hardware/thinkpad-x1-gen9.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, modulesPath, hardwareModules, ... }: { +{ config, lib, pkgs, modulesPath, hardwareModules, pkgFccUnlock, ... }: { imports = with hardwareModules; [ (modulesPath + "/installer/scan/not-detected.nix") @@ -12,7 +12,12 @@ boot.initrd.kernelModules = [ "dm-snapshot" ]; # TODO: This should be moved to defaults - environment.systemPackages = with pkgs; [ modemmanager libmbim ]; + environment.systemPackages = with pkgs; [ modemmanager libmbim ]; + + + environment.etc."ModemManager/fcc-unlock.d/1eac:1001" = { + source = "${pkgFccUnlock}/bin/fcc-unlock"; + }; # CPU Configuration hardware.cpu.intel.updateMicrocode = true; diff --git a/fcc-unlock b/fcc-unlock new file mode 160000 index 0000000..2ec601e --- /dev/null +++ b/fcc-unlock @@ -0,0 +1 @@ +Subproject commit 2ec601e9851c67913af403162c5346de3702eace diff --git a/flake.lock b/flake.lock index 690c804..cfe603c 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,25 @@ { "nodes": { + "fcc-unlock": { + "inputs": { + "nixos-stable": [ + "nixpkgs-stable" + ] + }, + "locked": { + "lastModified": 1665140084, + "narHash": "sha256-3rDi3/DemRvOzsdracVIiDumg7gq5BkzusNyaJdEA68=", + "ref": "HEAD", + "rev": "2ec601e9851c67913af403162c5346de3702eace", + "revCount": 2, + "type": "git", + "url": "file:///etc/nixos/fcc-unlock" + }, + "original": { + "type": "git", + "url": "file:///etc/nixos/fcc-unlock" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -23,11 +43,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1668973873, - "narHash": "sha256-DnTrRduUIRgsCBruvUXsaBw2G46JNq6/DtrM5R7VrRc=", + "lastModified": 1669146234, + "narHash": "sha256-HEby7EG1yaq1oT2Ze6Cvok9CFju1XHkSvVHmkptLW9U=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "1108c1b8614017c8b52005054fd27a00e4feb51b", + "rev": "0099253ad0b5283f06ffe31cf010af3f9ad7837d", "type": "github" }, "original": { @@ -38,11 +58,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1668984258, - "narHash": "sha256-0gDMJ2T3qf58xgcSbYoXiRGUkPWmKyr5C3vcathWhKs=", + "lastModified": 1669378442, + "narHash": "sha256-nm+4PN0A4SnV0SzEchxrMyKPvI3Ld/aoom4PnHeHucs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cf63ade6f74bbc9d2a017290f1b2e33e8fbfa70a", + "rev": "0faaf0a9bb6dedb69bfd43ac06fb27fadc476c51", "type": "github" }, "original": { @@ -54,11 +74,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1668994630, - "narHash": "sha256-1lqx6HLyw6fMNX/hXrrETG1vMvZRGm2XVC9O/Jt0T6c=", + "lastModified": 1669320964, + "narHash": "sha256-EBFw+ge12Pcr3qCk8If3/eMBAoQLR7ytndXZoRevUtM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "af50806f7c6ab40df3e6b239099e8f8385f6c78b", + "rev": "27ccd29078f974ddbdd7edc8e38c8c8ae003c877", "type": "github" }, "original": { @@ -78,11 +98,11 @@ ] }, "locked": { - "lastModified": 1668005131, - "narHash": "sha256-wjCtCCrS9RTMgT0ajoik340PcU7ym3p0z6SM66GuFI4=", + "lastModified": 1668780698, + "narHash": "sha256-XcvgI08rrzA71tXj3JK0ZvEofzLLb2DlQVuVjAtS4Kw=", "ref": "master", - "rev": "45ee37cb2f5089f9f6cab410690194ea474286c8", - "revCount": 238, + "rev": "fe42502147059db67e6b26b9df6da1ae19caf6b0", + "revCount": 241, "type": "git", "url": "file:///etc/nixos/qois-infrastructure" }, @@ -93,6 +113,7 @@ }, "root": { "inputs": { + "fcc-unlock": "fcc-unlock", "home-manager": "home-manager", "nixos-hardware": "nixos-hardware", "nixpkgs-stable": "nixpkgs-stable", diff --git a/flake.nix b/flake.nix index bf17907..6558779 100644 --- a/flake.nix +++ b/flake.nix @@ -17,11 +17,15 @@ }; threema.url = "git+file:///etc/nixos/defaults/threema"; threema.inputs.nixpkgs-unstable.follows = "nixpkgs-unstable"; + fcc-unlock = { + url = "git+file:///etc/nixos/fcc-unlock"; + inputs.nixos-stable.follows = "nixpkgs-stable"; + }; }; outputs = { self, nixpkgs-unstable, nixpkgs-stable, home-manager - , qois-infrastructure, nixos-hardware, threema, ... }@inputs: + , qois-infrastructure, nixos-hardware, threema, fcc-unlock, ... }@inputs: let system = "x86_64-linux"; pkgsUnstable = import nixpkgs-unstable { @@ -44,6 +48,7 @@ sharedSpecialArgs = { threemaModules = threema.nixosModules; inherit pkgsUnstable; + pkgFccUnlock = fcc-unlock.packages.${system}.default; }; home-manager-config = { @@ -61,7 +66,7 @@ hardwareModules = nixos-hardware.nixosModules; }; modules = [ - qois-infrastructure.nixosModule + qois-infrastructure.nixosModules.default home-manager.nixosModules.home-manager ./host/${host}/default.nix ] ++ (if host == "bachtel" then [ ] else [ home-manager-config ]); diff --git a/qois-infrastructure b/qois-infrastructure index 45ee37c..fe42502 160000 --- a/qois-infrastructure +++ b/qois-infrastructure @@ -1 +1 @@ -Subproject commit 45ee37cb2f5089f9f6cab410690194ea474286c8 +Subproject commit fe42502147059db67e6b26b9df6da1ae19caf6b0