From 29885591cedfd3603c5f27aada1bbce43f0ef155 Mon Sep 17 00:00:00 2001 From: xinyangli Date: Mon, 3 Apr 2023 17:41:33 +0800 Subject: [PATCH] laptop: Add wechat --- flake.lock | 121 +++++++++++++++++++++++++++++- flake.nix | 16 +++- machines/laptop/configuration.nix | 8 +- 3 files changed, 136 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index c22a2a7..19c8035 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,77 @@ { "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1638122382, + "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils-plus": { + "inputs": { + "flake-utils": [ + "nur-xddxdd", + "flake-utils" + ] + }, + "locked": { + "lastModified": 1657226504, + "narHash": "sha256-GIYNjuq4mJlFgqKsZ+YrgzWm0IpA4axA3MCrdKYj7gs=", + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "rev": "2bf0f91643c2e5ae38c1b26893ac2927ac9bd82a", + "type": "github" + }, + "original": { + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1678901627, + "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixos-cn": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs-stable" + ] + }, + "locked": { + "lastModified": 1680485243, + "narHash": "sha256-DyPq1Nn8f1TwBXqJBD4iicrv97ALg2IHW9YSw91oDhU=", + "owner": "nixos-cn", + "repo": "flakes", + "rev": "c2fd9273eadae18fecc2047180329fb05d739cf3", + "type": "github" + }, + "original": { + "owner": "nixos-cn", + "repo": "flakes", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1680213900, @@ -16,13 +88,29 @@ "type": "github" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1680334310, + "narHash": "sha256-ISWz16oGxBhF7wqAxefMPwFag6SlsA9up8muV79V9ck=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "884e3b68be02ff9d61a042bc9bd9dd2a358f95da", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, "nur": { "locked": { - "lastModified": 1680464750, - "narHash": "sha256-20bP0roHuVhncvCIu1FTkfKJ1QIKxG1IxfmBjKOiP3c=", + "lastModified": 1680505766, + "narHash": "sha256-5E6ZFt13gJnKIZChTSMnKU1nKjuzyaQ7s1jUgVl85hs=", "owner": "nix-community", "repo": "NUR", - "rev": "93e5e544f84b56d4b6bee62e0242e93ce5f11dee", + "rev": "f9584e3b5d8ea46f9b25631cbab588b14b7e0be0", "type": "github" }, "original": { @@ -31,10 +119,35 @@ "type": "github" } }, + "nur-xddxdd": { + "inputs": { + "flake-utils": "flake-utils_2", + "flake-utils-plus": "flake-utils-plus", + "nixpkgs": [ + "nixpkgs-stable" + ] + }, + "locked": { + "lastModified": 1680504755, + "narHash": "sha256-tDOIL7DWfxLUCCZawVbszzROGqzOYBYpP0XbPdVKNp8=", + "owner": "xddxdd", + "repo": "nur-packages", + "rev": "d24e41633775d7aa68a95c36a74905a324bd524f", + "type": "github" + }, + "original": { + "owner": "xddxdd", + "repo": "nur-packages", + "type": "github" + } + }, "root": { "inputs": { + "nixos-cn": "nixos-cn", "nixpkgs": "nixpkgs", - "nur": "nur" + "nixpkgs-stable": "nixpkgs-stable", + "nur": "nur", + "nur-xddxdd": "nur-xddxdd" } } }, diff --git a/flake.nix b/flake.nix index 492e415..f8f6210 100644 --- a/flake.nix +++ b/flake.nix @@ -2,14 +2,26 @@ inputs = { # Pin nixpkgs to a specific commit nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - # nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11"; + nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-22.11"; nur.url = "github:nix-community/NUR"; + nur-xddxdd = { + url = "github:xddxdd/nur-packages"; + inputs.nixpkgs.follows = "nixpkgs-stable"; }; - outputs = { self, nixpkgs, nur }: { + nixos-cn = { + url = "github:nixos-cn/flakes"; + # Use the same nixpkgs + inputs.nixpkgs.follows = "nixpkgs-stable"; + }; + }; + + + outputs = { self, nixpkgs, nur, nixos-cn, ...}@attrs: { nixosConfigurations.xin-laptop = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; + specialArgs = attrs; modules = [ nur.nixosModules.nur machines/laptop/configuration.nix diff --git a/machines/laptop/configuration.nix b/machines/laptop/configuration.nix index f3f66c6..0b5fef1 100644 --- a/machines/laptop/configuration.nix +++ b/machines/laptop/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: +{ config, pkgs, nixos-cn, nur-xddxdd, ... }: { imports = @@ -150,7 +150,7 @@ # VCS git git-crypt - + jetbrains.jdk # patch jetbrain runtime java jetbrains.clion jetbrains.pycharm-professional @@ -204,6 +204,8 @@ # IM tdesktop qq + nur-xddxdd.packages.${system}.wechat-uos-bin + # nixos-cn.legacyPackages.${system}.wechat-uos # Mail thunderbird @@ -305,7 +307,7 @@ # hardware.nvidia.open = true; hardware.nvidia.prime = { offload.enable = true; - # offload.enableOffloadCmd = true; + offload.enableOffloadCmd = true; nvidiaBusId = "PCI:1:0:0"; amdgpuBusId = "PCI:4:0:0"; };