From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id YOf1NWNBZ2DzbwAAgWs5BA (envelope-from ) for ; Fri, 02 Apr 2021 18:08:03 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id CPq+L2NBZ2AoDQAAB5/wlQ (envelope-from ) for ; Fri, 02 Apr 2021 16:08:03 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2216F18CBC for ; Fri, 2 Apr 2021 18:08:03 +0200 (CEST) Received: from localhost ([::1]:33250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSML3-0003zX-M0 for larch@yhetil.org; Fri, 02 Apr 2021 12:08:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSMKq-0003vC-Pt for help-guix@gnu.org; Fri, 02 Apr 2021 12:07:48 -0400 Received: from knopi.disroot.org ([178.21.23.139]:35828) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSMKn-0004hO-V0 for help-guix@gnu.org; Fri, 02 Apr 2021 12:07:48 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 631C850CDA; Fri, 2 Apr 2021 18:07:43 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aLKCdIkoLAaj; Fri, 2 Apr 2021 18:07:41 +0200 (CEST) References: <87ft09fowi.fsf@disroot.org> <87eefsg7fk.fsf@disroot.org> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1617379659; bh=2S96zKYR89pLv7f8qapicBNQ78wTTgcQQ/WU2y3AGYk=; h=References:From:To:Cc:Subject:In-reply-to:Date; b=AH9MYPHs46B8EK1i1Lw9c0ZgFqksp8hr84kYafmBj/NFPbwWa057xE7homcuBM0pd G/NW1ZviG2otirFaSvz21RxiwsW6rGl+AlD9h9aT61exAJCJlUk6DB0pAFIlnLkfxr X5fG3h19dAce1sYW6xX168yXNSiqXOBQK34xj2lJlrqHa1z+iac2rTf9BG7r4LgGLL d/HKzGI0CPh7tMcrfBK50CeJHPJUIkTwgZn6mCWOws1E2tH8bx5LMqZaqa4CO4+yS9 vkPJSfXD7TUdg6WXPutZZsxE1pQE9XnAjdO9ekeRRAQ1kL7+6xxHxHtOe5hFdSxi1p PU8s9xSM+QZAw== From: Gary Johnson To: Bone Baboon Cc: phil@beadling.co.uk, help-guix@gnu.org Subject: Re: Edits to `etc/resolv.conf` being overwritten In-reply-to: <87eefsg7fk.fsf@disroot.org> Date: Fri, 02 Apr 2021 12:07:24 -0400 Message-ID: <87blaw1xhf.fsf@disroot.org> Mime-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=178.21.23.139; envelope-from=lambdatronic@disroot.org; helo=knopi.disroot.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1617379683; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=5s/DNs2s3ykQ2uHJKKbzm/aNr9e/h1AUWji/q4cptIE=; b=QuL6oO0lmJ35VeAoDB2nqUOJDC1AmjvWYLLWu8O1a/DArVvT5ncrYUWl4nmj4MRgwKrnfi M9WcL5jXZn/gXU83+u/3xKaD/I7wWPHdMR2eReo+4nQo8zgGilHMBPkQJfzHpucjfrGeJS hNcPEGG3EA6quNlylTLIgnj/h413nT0E4PH8eyHVu8YVwy6JLVp76pbMeE5Zj/sVDkA5wa szkX25+ng11nQPcvmg6C3PRPlsHvsO6CstjhnR9RDbVBXSRlpAhnLi3+g4wvfuRFw3VyD+ pwnOb8aYuvj25+9txCtAdfRg3i9eNfqp5bpwVebkfHp74Zzax+BM+PhlxRpSag== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617379683; a=rsa-sha256; cv=none; b=Oi6yUnutMgZQbGEgDLpuYm46KMG0QFxZcr8xpLmDhaj6NwXwdqJkYXz8RvYiGWCzQ8GVmg OtwBL44SCVDOmje6VaR39NCspK4WUL8j/SKM110vcK7dSQbHh3DMvhlQezxHr8sMEWYoaE cWKOQmzefcI2ijp2gQ4cKdtjlnT+LaholamPgKf4vb5OC92MjkvsL385TPiWf0wolAEXL5 4N97oOT9jOsVf8P0tzGxTXdlztdtP54C7s3LVthGdRgt+lD7+tp84HDXb30Uo7OWA2TmhI dInmaHYk/QVQ0T2e96XIASMymrqUuTIbU7iKMNF8cVpfwqqTemwoysvi12QEWA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=disroot.org header.s=mail header.b=AH9MYPHs; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Spam-Score: -1.13 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=disroot.org header.s=mail header.b=AH9MYPHs; dmarc=pass (policy=quarantine) header.from=disroot.org; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: 2216F18CBC X-Spam-Score: -1.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: egbA1JhohJMx Bone Baboon writes: >> Any suggestion on how to stop my edits of `etc/resolv.conf` from being >> overwritten? >> >> `/etc/resolv.conf` is being overwritten removing changes I save to it. >> My edits to `etc/resolv.conf` specify some name servers. Some time >> after my edits are saved the file is completely rewritten to it's >> original contents before I made my edits. The original contents include >> nameserver, domain and search for my internet service provider's DNS. When running Guix System, your OS configuration is meant to be fully derived from evaluating your `operating-system` definition. This means, in particular, that you should not manually edit any files outside of your home directories (i.e., /root and /home/*). This includes, of course, any files under /etc. Instead, any custom changes that you want to see under /etc need to be included in your `operating-system` definition. The way to do this depends on the change you want to make. For example, if you want to edit /etc/sudoers, you should include this field in your `operating-system` definition (on the same level as `packages`, `services`, and so on): (sudoers-file (plain-file "sudoers" my-sudoers)) Then remember to define `my-sudoers` somewhere above the `operating-system` form. Here's an example: (define my-sudoers "root ALL=(ALL) ALL %wheel ALL=(ALL) ALL ") Similarly, if you want to modify /etc/hosts, you add this to `operating-system`: (hosts-file (plain-file "hosts" (string-append (local-host-aliases host-name) my-host-aliases))) And again define my-host-aliases somewhere above `operating-system`: (define my-host-aliases " # Some Servers 123.123.123.100 foo 123.123.123.101 bar 123.123.123.102 baz ") Most other files under /etc are managed by different services. You should review the "Guix Services" section of the info pages to find the appropriate service for whatever files you want to modify. As of today, I'm not aware of a Guix service that modifies /etc/resolv.conf other than the network-manager-service-type (which is what I use on my system). However, if you are not using NetworkManager and want to manually set the values in /etc/resolv.conf such that they persist across calls to `guix system reconfigure`, you should add this form to the `services` list in your `operating-system` definition: (simple-service 'resolv-service etc-service-type `(("resolv.conf" ,(plain-file "resolv.conf" my-resolv.conf)))) And finally remember to define `my-resolv.conf` above `operating-system`: (define my-resolv.conf "# Generated by Guix! nameserver 255.255.255.1 nameserver ffff:ffff:ffff::1 ") Have fun and happy hacking! Gary -- GPG Key ID: 7BC158ED Use `gpg --search-keys lambdatronic' to find me Protect yourself from surveillance: https://emailselfdefense.fsf.org ======================================================================= () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments Why is HTML email a security nightmare? See https://useplaintext.email/ Please avoid sending me MS-Office attachments. See http://www.gnu.org/philosophy/no-word-attachments.html