hosts: add socrates

- gh need to store credentials in hosts.yaml
This commit is contained in:
Guanran Wang 2024-03-20 23:01:42 +08:00
parent 27461cc129
commit 81b0ee0ded
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8
5 changed files with 254 additions and 10 deletions

View file

@ -254,6 +254,32 @@
"type": "github" "type": "github"
} }
}, },
"nix-formatter-pack": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"nmd": [
"nmd"
],
"nmt": [
"nmt"
]
},
"locked": {
"lastModified": 1709879831,
"narHash": "sha256-PZFXvKm929A3waipt2prRKYlNJvGQiBxWPDn/MIOKWo=",
"owner": "Gerschtli",
"repo": "nix-formatter-pack",
"rev": "2499f41a01f1154c5a3b967aabe37d94e6b6d18b",
"type": "github"
},
"original": {
"owner": "Gerschtli",
"repo": "nix-formatter-pack",
"type": "github"
}
},
"nix-gaming": { "nix-gaming": {
"inputs": { "inputs": {
"flake-parts": [ "flake-parts": [
@ -277,6 +303,40 @@
"type": "github" "type": "github"
} }
}, },
"nix-on-droid": {
"inputs": {
"home-manager": [
"home-manager"
],
"nix-formatter-pack": [
"nix-formatter-pack"
],
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-docs": [
"nixpkgs"
],
"nixpkgs-for-bootstrap": "nixpkgs-for-bootstrap",
"nmd": [
"nmd"
]
},
"locked": {
"lastModified": 1709879753,
"narHash": "sha256-zEpy3eweBus/cW/oRMBINps6Bnlazpa7TadonwWibHA=",
"owner": "nix-community",
"repo": "nix-on-droid",
"rev": "7b3cc6e3f9919b2d23003cfafb60c146c3f45793",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-23.11",
"repo": "nix-on-droid",
"type": "github"
}
},
"nixcasks": { "nixcasks": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -328,6 +388,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-for-bootstrap": {
"locked": {
"lastModified": 1708105575,
"narHash": "sha256-sS4AItZeUnAei6v8FqxNlm+/27MPlfoGym/TZP0rmH0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1d1817869c47682a6bee85b5b0a6537b6c0fba26",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1d1817869c47682a6bee85b5b0a6537b6c0fba26",
"type": "github"
}
},
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1709569716, "lastModified": 1709569716,
@ -344,6 +420,45 @@
"type": "github" "type": "github"
} }
}, },
"nmd": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"scss-reset": [
"scss-reset"
]
},
"locked": {
"lastModified": 1705050560,
"narHash": "sha256-x3zzcdvhJpodsmdjqB4t5mkVW22V3wqHLOun0KRBzUI=",
"owner": "~rycee",
"repo": "nmd",
"rev": "66d9334933119c36f91a78d565c152a4fdc8d3d3",
"type": "sourcehut"
},
"original": {
"owner": "~rycee",
"repo": "nmd",
"type": "sourcehut"
}
},
"nmt": {
"flake": false,
"locked": {
"lastModified": 1705307515,
"narHash": "sha256-krVKx3/u1mDo8qe5qylYgmwAmlAPHa1BSPDzxq09FmI=",
"owner": "~rycee",
"repo": "nmt",
"rev": "1562940b7765a32f1987bd9a3ee6a4fa034c9429",
"type": "sourcehut"
},
"original": {
"owner": "~rycee",
"repo": "nmt",
"type": "sourcehut"
}
},
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1709714153, "lastModified": 1709714153,
@ -431,15 +546,20 @@
"lanzaboote": "lanzaboote", "lanzaboote": "lanzaboote",
"neovim": "neovim", "neovim": "neovim",
"nix-darwin": "nix-darwin", "nix-darwin": "nix-darwin",
"nix-formatter-pack": "nix-formatter-pack",
"nix-gaming": "nix-gaming", "nix-gaming": "nix-gaming",
"nix-on-droid": "nix-on-droid",
"nixcasks": "nixcasks", "nixcasks": "nixcasks",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable", "nixpkgs-stable": "nixpkgs-stable",
"nmd": "nmd",
"nmt": "nmt",
"nur": "nur", "nur": "nur",
"nvfetcher": "nvfetcher", "nvfetcher": "nvfetcher",
"pre-commit-hooks-nix": "pre-commit-hooks-nix", "pre-commit-hooks-nix": "pre-commit-hooks-nix",
"rust-overlay": "rust-overlay", "rust-overlay": "rust-overlay",
"scss-reset": "scss-reset",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"spicetify-nix": "spicetify-nix", "spicetify-nix": "spicetify-nix",
"systems": "systems", "systems": "systems",
@ -469,6 +589,22 @@
"type": "github" "type": "github"
} }
}, },
"scss-reset": {
"flake": false,
"locked": {
"lastModified": 1683906868,
"narHash": "sha256-cif5Sx8Ca5vxdw/mNAgpulLH15TwmzyJFNM7JURpoaE=",
"owner": "andreymatin",
"repo": "scss-reset",
"rev": "5a7bd491ac82441e6283fb0d5d54644b913b30c7",
"type": "github"
},
"original": {
"owner": "andreymatin",
"repo": "scss-reset",
"type": "github"
}
},
"sops-nix": { "sops-nix": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [

View file

@ -57,6 +57,14 @@
nixos-hardware = { nixos-hardware = {
url = "github:NixOS/nixos-hardware"; url = "github:NixOS/nixos-hardware";
}; };
nix-on-droid = {
url = "github:nix-community/nix-on-droid/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-docs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
inputs.nix-formatter-pack.follows = "nix-formatter-pack";
inputs.nmd.follows = "nmd";
};
nixcasks = { nixcasks = {
# contains unfree # contains unfree
url = "github:jacekszymanski/nixcasks"; url = "github:jacekszymanski/nixcasks";
@ -97,6 +105,21 @@
url = "github:hercules-ci/gitignore.nix"; url = "github:hercules-ci/gitignore.nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nix-formatter-pack = {
url = "github:Gerschtli/nix-formatter-pack";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nmd.follows = "nmd";
inputs.nmt.follows = "nmt";
};
nmd = {
url = "sourcehut:~rycee/nmd";
inputs.nixpkgs.follows = "nixpkgs";
inputs.scss-reset.follows = "scss-reset";
};
nmt = {
url = "sourcehut:~rycee/nmt";
flake = false;
};
nvfetcher = { nvfetcher = {
url = "github:berberman/nvfetcher"; url = "github:berberman/nvfetcher";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -116,6 +139,10 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils"; inputs.flake-utils.follows = "flake-utils";
}; };
scss-reset = {
url = "github:andreymatin/scss-reset";
flake = false;
};
}; };
outputs = inputs: outputs = inputs:
@ -144,6 +171,12 @@
inherit system modules; inherit system modules;
specialArgs = {inherit inputs;}; specialArgs = {inherit inputs;};
}; };
mkDroid = modules:
inputs.nix-on-droid.lib.nixOnDroidConfiguration {
inherit modules;
extraSpecialArgs = {inherit inputs;};
};
in { in {
### imports = []; ### imports = [];
nixosModules.default = ./nixos/modules; nixosModules.default = ./nixos/modules;
@ -164,5 +197,9 @@
"plato" = mkDarwin "x86_64-darwin" [./hosts/plato]; "plato" = mkDarwin "x86_64-darwin" [./hosts/plato];
"whitesteel" = mkDarwin "x86_64-darwin" [./hosts/whitesteel]; "whitesteel" = mkDarwin "x86_64-darwin" [./hosts/whitesteel];
}; };
nixOnDroidConfigurations = {
"socrates" = mkDroid [./hosts/socrates];
};
}); });
} }

View file

@ -1,5 +1,4 @@
{ {
programs.gh.enable = true;
programs.git = { programs.git = {
enable = true; enable = true;
userName = "Guanran Wang"; userName = "Guanran Wang";
@ -13,9 +12,5 @@
}; };
}; };
xdg.configFile."gh/hosts.yml".text = '' programs.gh.enable = true;
github.com:
git_protocol: https
user: Guanran928
'';
} }

View file

@ -2,14 +2,19 @@
inputs, inputs,
pkgs, pkgs,
config, config,
lib,
... ...
}: { }: {
home = { home = {
username = "guanranwang"; # for nix-on-droid
username = lib.mkDefault "guanranwang";
homeDirectory = homeDirectory =
if pkgs.stdenv.hostPlatform.isDarwin lib.mkDefault
then "/Users/${config.home.username}" (
else "/home/${config.home.username}"; if pkgs.stdenv.hostPlatform.isDarwin
then "/Users/${config.home.username}"
else "/home/${config.home.username}"
);
# This value determines the Home Manager release that your # This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage # configuration is compatible with. This helps avoid breakage

View file

@ -0,0 +1,71 @@
{
config,
lib,
pkgs,
inputs,
...
}: {
environment.packages = with pkgs; [
git
openssh
diffutils
findutils
utillinux
tzdata
hostname
man
gnugrep
gnupg
gnused
gnutar
bzip2
gzip
xz
zip
unzip
];
# Backup etc files instead of failing to activate generation if a file already exists in /etc
environment.etcBackupExtension = ".bak";
# Read the changelog before changing this value
system.stateVersion = "24.05";
# Set up nix for flakes
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
# Set your time zone
time.timeZone = "Asia/Shanghai";
# Set termux font
# NOTE: Use "Mono" variation, or Termux will cut your icons in half
terminal.font = "${pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];}}/share/fonts/truetype/NerdFonts/JetBrainsMonoNerdFontMono-Regular.ttf";
# Set user shell
user.shell = lib.getExe pkgs.fish;
environment.sessionVariables."SHELL" = lib.getExe pkgs.fish;
# Set up HM
home-manager = {
backupFileExtension = "hmbak";
useGlobalPkgs = true;
extraSpecialArgs = {
inherit inputs;
osConfig = config;
};
config = ../../home;
sharedModules = [
({...}: {
imports = [
../../home/applications/bash
../../home/applications/fish
../../home/applications/neovim
../../home/applications/nix
];
})
];
};
}