commit 0e0426120ac6fcedce01ad01fc44911806ed45f5 Author: Gabriel Arazas Date: Sun Nov 5 20:19:00 2023 +0800 project: init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2d54fd6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +### NixOS ### +result* +*.qcow2 + +### direnv ### +.direnv +.envrc + diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..35019b6 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1699099776, + "narHash": "sha256-X09iKJ27mGsGambGfkKzqvw5esP1L/Rf8H3u3fCqIiU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "85f1ba3e51676fa8cc604a3d863d729026a6b8eb", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1699291058, + "narHash": "sha256-5ggduoaAMPHUy4riL+OrlAZE14Kh7JWX4oLEs22ZqfU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "41de143fda10e33be0f47eab2bfe08a50f234267", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1699343069, + "narHash": "sha256-s7BBhyLA6MI6FuJgs4F/SgpntHBzz40/qV0xLPW6A1Q=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ec750fd01963ab6b20ee1f0cb488754e8036d89d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "nixpkgs-stable": "nixpkgs-stable", + "nixpkgs-unstable": "nixpkgs-unstable" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..070152b --- /dev/null +++ b/flake.nix @@ -0,0 +1,18 @@ +{ + description = "Very simple sample of a Nix flake with NixOS and home-manager"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.05"; + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + }; + + outputs = inputs@{ nixpkgs, ... }: { + nixosConfigurations.desktop = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./hosts/desktop + ]; + }; + }; +} diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix new file mode 100644 index 0000000..c6fb0c9 --- /dev/null +++ b/hosts/desktop/default.nix @@ -0,0 +1,24 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + fileSystems."/".label = "root"; + fileSystems."/boot".label = "boot"; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + system.stateVersion = "23.05"; + + services.openssh = { + enable = true; + settings.PermitRootLogin = "yes"; + }; + + users.users.nixos = { + isNormalUser = true; + extraGroups = [ "wheel" "networkmanager" "audio" ]; + initialHashedPassword = ""; + }; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; +}